diff --git a/bin/tests/system/inline/ns8/example.db.in b/bin/tests/system/inline/ns8/example.db.in new file mode 100644 index 0000000000..bbe28feeb6 --- /dev/null +++ b/bin/tests/system/inline/ns8/example.db.in @@ -0,0 +1,24 @@ +; Copyright (C) Internet Systems Consortium, Inc. ("ISC") +; +; This Source Code Form is subject to the terms of the Mozilla Public +; License, v. 2.0. If a copy of the MPL was not distributed with this +; file, You can obtain one at http://mozilla.org/MPL/2.0/. +; +; See the COPYRIGHT file distributed with this work for additional +; information regarding copyright ownership. + +$TTL 300 +@ IN SOA mname1. . ( + 1 ; serial + 20 ; refresh (20 seconds) + 20 ; retry (20 seconds) + 1814400 ; expire (3 weeks) + 3600 ; minimum (1 hour) + ) + + NS ns8 +ns8 A 10.53.0.8 + +a A 10.0.0.1 +b A 10.0.0.2 +c A 10.0.0.3 diff --git a/bin/tests/system/inline/ns8/example2.db.in b/bin/tests/system/inline/ns8/example2.db.in new file mode 100644 index 0000000000..73616d735a --- /dev/null +++ b/bin/tests/system/inline/ns8/example2.db.in @@ -0,0 +1,24 @@ +; Copyright (C) Internet Systems Consortium, Inc. ("ISC") +; +; This Source Code Form is subject to the terms of the Mozilla Public +; License, v. 2.0. If a copy of the MPL was not distributed with this +; file, You can obtain one at http://mozilla.org/MPL/2.0/. +; +; See the COPYRIGHT file distributed with this work for additional +; information regarding copyright ownership. + +$TTL 300 +@ IN SOA mname1. . ( + 2 ; serial + 20 ; refresh (20 seconds) + 20 ; retry (20 seconds) + 1814400 ; expire (3 weeks) + 3600 ; minimum (1 hour) + ) + + NS ns8 +ns8 A 10.53.0.8 + +a A 10.0.0.1 +b A 10.0.0.2 +c A 10.0.0.3 diff --git a/bin/tests/system/inline/ns8/example3.db.in b/bin/tests/system/inline/ns8/example3.db.in new file mode 100644 index 0000000000..b8c55a5f7c --- /dev/null +++ b/bin/tests/system/inline/ns8/example3.db.in @@ -0,0 +1,24 @@ +; Copyright (C) Internet Systems Consortium, Inc. ("ISC") +; +; This Source Code Form is subject to the terms of the Mozilla Public +; License, v. 2.0. If a copy of the MPL was not distributed with this +; file, You can obtain one at http://mozilla.org/MPL/2.0/. +; +; See the COPYRIGHT file distributed with this work for additional +; information regarding copyright ownership. + +$TTL 400 +@ IN SOA mname1. . ( + 3 ; serial + 20 ; refresh (20 seconds) + 20 ; retry (20 seconds) + 1814400 ; expire (3 weeks) + 3600 ; minimum (1 hour) + ) + + NS ns8 +ns8 A 10.53.0.8 + +a A 10.0.0.1 +b A 10.0.0.2 +c A 10.0.0.3 diff --git a/bin/tests/system/inline/ns8/named.conf.in b/bin/tests/system/inline/ns8/named.conf.in index 8663ee867b..242c4dc870 100644 --- a/bin/tests/system/inline/ns8/named.conf.in +++ b/bin/tests/system/inline/ns8/named.conf.in @@ -144,3 +144,10 @@ zone "example16.com" { auto-dnssec maintain; file "example16.com.db"; }; + +zone example { + type primary; + inline-signing yes; + auto-dnssec maintain; + file "example.db"; +}; diff --git a/bin/tests/system/inline/ns8/sign.sh b/bin/tests/system/inline/ns8/sign.sh index 57daf402a2..9033c72079 100755 --- a/bin/tests/system/inline/ns8/sign.sh +++ b/bin/tests/system/inline/ns8/sign.sh @@ -23,3 +23,10 @@ do cp example.com.db.in ${zone}.db $SIGNER -S -T 3600 -O raw -o ${zone} ${zone}.db > /dev/null 2>&1 done + +zone=example +rm -f K${zone}.+*+*.key +rm -f K${zone}.+*+*.private +keyname=`$KEYGEN -q -a $DEFAULT_ALGORITHM -b $DEFAULT_BITS -n zone $zone` +keyname=`$KEYGEN -q -a $DEFAULT_ALGORITHM -b $DEFAULT_BITS -n zone -f KSK $zone` +cp ${zone}.db.in ${zone}.db diff --git a/bin/tests/system/inline/tests.sh b/bin/tests/system/inline/tests.sh index f2e6a7b1eb..3bfac90f0d 100755 --- a/bin/tests/system/inline/tests.sh +++ b/bin/tests/system/inline/tests.sh @@ -14,6 +14,14 @@ DIGOPTS="+tcp +dnssec -p ${PORT}" RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s" +dig_with_opts() { + $DIG $DIGOPTS "$@" +} + +rndccmd() { + $RNDCCMD "$@" +} + wait_for_serial() ( $DIG $DIGOPTS "@$1" "$2" SOA > "$4" serial=$(awk '$4 == "SOA" { print $7 }' "$4") @@ -1434,5 +1442,49 @@ grep "ixfr-from-differences: unchanged" nextpart.post$n.out && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` +n=$((n+1)) +echo_i "Check that 'rndc reload' of just the serial updates the signed instance ($n)" +ret=0 +dig_with_opts @10.53.0.8 example SOA > dig.out.ns8.test$n.soa1 || ret=1 +cp ns8/example2.db.in ns8/example.db || ret=1 +nextpart ns8/named.run > /dev/null +rndccmd 10.53.0.8 reload || ret=1 +wait_for_log 3 "all zones loaded" ns8/named.run +sleep 1 +dig_with_opts @10.53.0.8 example SOA > dig.out.ns8.test$n.soa2 || ret=1 +soa1=$(awk '$4 == "SOA" { print $7 }' dig.out.ns8.test$n.soa1) +soa2=$(awk '$4 == "SOA" { print $7 }' dig.out.ns8.test$n.soa2) +ttl1=$(awk '$4 == "SOA" { print $2 }' dig.out.ns8.test$n.soa1) +ttl2=$(awk '$4 == "SOA" { print $2 }' dig.out.ns8.test$n.soa2) +test ${soa1:-1000} -lt ${soa2:-0} || ret=1 +test ${ttl1:-0} -eq 300 || ret=1 +test ${ttl2:-0} -eq 300 || ret=1 +test "$ret" -eq 0 || echo_i "failed" +status=$((status+ret)) + +n=$((n+1)) +echo_i "Check that restart with zone changes and deleted journal works ($n)" +TSIG= +ret=0 +dig_with_opts @10.53.0.8 example SOA > dig.out.ns8.test$n.soa1 || ret=1 +stop_server --use-rndc --port ${CONTROLPORT} inline ns8 +# TTL of all records change from 300 to 400 +cp ns8/example3.db.in ns8/example.db || ret=1 +rm ns8/example.db.jnl +nextpart ns8/named.run > /dev/null +start_server --noclean --restart --port ${PORT} inline ns8 +wait_for_log 3 "all zones loaded" ns8/named.run +sleep 1 +dig_with_opts @10.53.0.8 example SOA > dig.out.ns8.test$n.soa2 || ret=1 +soa1=$(awk '$4 == "SOA" { print $7 }' dig.out.ns8.test$n.soa1) +soa2=$(awk '$4 == "SOA" { print $7 }' dig.out.ns8.test$n.soa2) +ttl1=$(awk '$4 == "SOA" { print $2 }' dig.out.ns8.test$n.soa1) +ttl2=$(awk '$4 == "SOA" { print $2 }' dig.out.ns8.test$n.soa2) +test ${soa1:-1000} -lt ${soa2:-0} || ret=1 +test ${ttl1:-0} -eq 300 || ret=1 +test ${ttl2:-0} -eq 400 || ret=1 +test "$ret" -eq 0 || echo_i "failed" +status=$((status+ret)) + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1