]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that 'check-names {secondary|slave} ignore;' works
authorMark Andrews <marka@isc.org>
Tue, 28 Sep 2021 23:36:02 +0000 (09:36 +1000)
committerMark Andrews <marka@isc.org>
Wed, 29 Sep 2021 09:18:59 +0000 (09:18 +0000)
bin/tests/system/checknames/ns4/named.conf.in
bin/tests/system/checknames/ns4/primary-ignore.update.db.in
bin/tests/system/checknames/ns5/master-ignore.update.db.in
bin/tests/system/checknames/ns5/named.conf.in
bin/tests/system/checknames/tests.sh

index dd6e8fd1a17dc3b2daa1030a4fc1b3579fb0ccfb..62b807edeef66bc67ee0b18ad015c816ca7658a5 100644 (file)
@@ -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";
+};
index f7864ab322a35eeb9664441ef02a99ce489ef6d1..7b2270f097ab15aacf0f6eb33a3877d78f8bdddd 100644 (file)
@@ -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
index f7864ab322a35eeb9664441ef02a99ce489ef6d1..a3be758c29b37f75bccdc0ea64f310bd51f4b279 100644 (file)
@@ -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
index 51344b507e1dbda04bf1aeb2b31fe7c535ebb026..d5c4244a33ff866b87fd935b09b67b2bba467308 100644 (file)
@@ -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";
+};
index c97dc7c28c5a2197457b36de62d261749f7f6a83..ac928949733f5fe63cd5b85e381c014c42a033b6 100644 (file)
@@ -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