From: Mark Andrews Date: Tue, 28 Sep 2021 23:36:02 +0000 (+1000) Subject: Check that 'check-names {secondary|slave} ignore;' works X-Git-Tag: v9.17.19~23^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b0d400d7c0b49f0e63e1541e19cb1c95189b3dd;p=thirdparty%2Fbind9.git Check that 'check-names {secondary|slave} ignore;' works --- diff --git a/bin/tests/system/checknames/ns4/named.conf.in b/bin/tests/system/checknames/ns4/named.conf.in index dd6e8fd1a17..62b807edeef 100644 --- a/bin/tests/system/checknames/ns4/named.conf.in +++ b/bin/tests/system/checknames/ns4/named.conf.in @@ -20,6 +20,7 @@ options { recursion yes; dnssec-validation yes; check-names primary ignore; + check-names secondary ignore; notify yes; }; @@ -33,3 +34,9 @@ zone "primary-ignore.update" { file "primary-ignore.update.db"; allow-update { any; }; }; + +zone "master-ignore.update" { + type secondary; + primaries { 10.53.0.5; }; + file "secondary-ignore.update.db"; +}; diff --git a/bin/tests/system/checknames/ns4/primary-ignore.update.db.in b/bin/tests/system/checknames/ns4/primary-ignore.update.db.in index f7864ab322a..7b2270f097a 100644 --- a/bin/tests/system/checknames/ns4/primary-ignore.update.db.in +++ b/bin/tests/system/checknames/ns4/primary-ignore.update.db.in @@ -8,7 +8,9 @@ ; information regarding copyright ownership. $TTL 300 -@ SOA ns1.ignore.update. hostmaster.ignore.update. ( +@ SOA ns4 hostmaster.ignore.update. ( 1 3600 1200 604800 3600 ) - NS ns1.ignore.update. -ns1.ignore.update. A 10.53.0.1 + NS ns4 + NS ns5 +ns4 A 10.53.0.4 +ns5 A 10.53.0.5 diff --git a/bin/tests/system/checknames/ns5/master-ignore.update.db.in b/bin/tests/system/checknames/ns5/master-ignore.update.db.in index f7864ab322a..a3be758c29b 100644 --- a/bin/tests/system/checknames/ns5/master-ignore.update.db.in +++ b/bin/tests/system/checknames/ns5/master-ignore.update.db.in @@ -8,7 +8,9 @@ ; information regarding copyright ownership. $TTL 300 -@ SOA ns1.ignore.update. hostmaster.ignore.update. ( +@ SOA ns5. hostmaster.ignore.update. ( 1 3600 1200 604800 3600 ) - NS ns1.ignore.update. -ns1.ignore.update. A 10.53.0.1 + NS ns4 + NS ns5 +ns4 A 10.53.0.4 +ns5 A 10.53.0.5 diff --git a/bin/tests/system/checknames/ns5/named.conf.in b/bin/tests/system/checknames/ns5/named.conf.in index 51344b507e1..d5c4244a33f 100644 --- a/bin/tests/system/checknames/ns5/named.conf.in +++ b/bin/tests/system/checknames/ns5/named.conf.in @@ -20,6 +20,7 @@ options { recursion yes; dnssec-validation yes; check-names master ignore; + check-names slave ignore; notify yes; }; @@ -33,3 +34,9 @@ zone "master-ignore.update" { file "master-ignore.update.db"; allow-update { any; }; }; + +zone "primary-ignore.update" { + type secondary; + primaries { 10.53.0.4; }; + file "primary-ignore.update.db"; +}; diff --git a/bin/tests/system/checknames/tests.sh b/bin/tests/system/checknames/tests.sh index c97dc7c28c5..ac928949733 100644 --- a/bin/tests/system/checknames/tests.sh +++ b/bin/tests/system/checknames/tests.sh @@ -16,6 +16,12 @@ n=1 DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p ${PORT}" +wait_for_record () { + $DIG $DIGOPTS "$1" "$2" "$3" > "$4" || return 1 + grep NOERROR "$4" > /dev/null || return 1 + return 0 +} + # Entry should exist. echo_i "check for failure from on zone load for 'check-names fail;' ($n)" ret=0 @@ -160,5 +166,23 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) n=$((n+1)) +echo_i "check that updates to 'check-names secondary ignore;' succeed and are not logged ($n)" +ret=0 +# takes a while for the transfer to succeed as ns5 (primary) is started after ns4 (secondary) +# and the zone is still loading when we get to this point. +retry_quiet 35 wait_for_record xxx_xxx.master-ignore.update @10.53.0.4 A dig.out.ns4.test$n || ret=1 +grep "xxx_xxx.master-ignore.update/A.*(check-names)" ns4/named.run > /dev/null && ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` +n=`expr $n + 1` + +echo_i "check that updates to 'check-names master ignore;' succeed and are not logged ($n)" +ret=0 +retry_quiet 35 wait_for_record xxx_xxx.primary-ignore.update @10.53.0.5 A dig.out.ns5.test$n || ret=1 +grep "xxx_xxx.primary-ignore.update/A.*(check-names)" ns5/named.run > /dev/null && ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status+ret)) +n=$((n+1)) + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1