From: Mark Andrews Date: Mon, 19 Jul 2021 22:48:48 +0000 (+1000) Subject: Check that restart with zone changes and deleted journal works X-Git-Tag: v9.17.17~10^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=163fb0b825c6a8beada76847283be7b24b6de5b9;p=thirdparty%2Fbind9.git Check that restart with zone changes and deleted journal works --- diff --git a/bin/tests/system/kasp/ns6/example3.db.in b/bin/tests/system/kasp/ns6/example3.db.in new file mode 100644 index 00000000000..7f716a98bdd --- /dev/null +++ b/bin/tests/system/kasp/ns6/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 ns6 +ns6 A 10.53.0.6 + +a A 10.0.0.1 +b A 10.0.0.2 +c A 10.0.0.3 diff --git a/bin/tests/system/kasp/tests.sh b/bin/tests/system/kasp/tests.sh index e2c04917999..9fec46297e0 100644 --- a/bin/tests/system/kasp/tests.sh +++ b/bin/tests/system/kasp/tests.sh @@ -4641,5 +4641,29 @@ 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.6 example SOA > dig.out.ns6.test$n.soa1 || ret=1 +stop_server --use-rndc --port ${CONTROLPORT} kasp ns6 +# TTL of all records change from 300 to 400 +cp ns6/example3.db.in ns6/example.db || ret=1 +rm ns6/example.db.jnl +nextpart ns6/named.run > /dev/null +start_server --noclean --restart --port ${PORT} kasp ns6 +wait_for_log 3 "all zones loaded" ns6/named.run +sleep 1 +dig_with_opts @10.53.0.6 example SOA > dig.out.ns6.test$n.soa2 || ret=1 +soa1=$(awk '$4 == "SOA" { print $7 }' dig.out.ns6.test$n.soa1) +soa2=$(awk '$4 == "SOA" { print $7 }' dig.out.ns6.test$n.soa2) +ttl1=$(awk '$4 == "SOA" { print $2 }' dig.out.ns6.test$n.soa1) +ttl2=$(awk '$4 == "SOA" { print $2 }' dig.out.ns6.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)) +n=$((n+1)) + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1