]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that 'check-names master ignore;' works
authorMark Andrews <marka@isc.org>
Sat, 18 Sep 2021 23:34:33 +0000 (09:34 +1000)
committerMark Andrews <marka@isc.org>
Wed, 29 Sep 2021 09:51:53 +0000 (19:51 +1000)
(cherry picked from commit 9107c8caeb11b9f5e4262a86fd1f09b8be86ba83)

bin/tests/system/checknames/clean.sh
bin/tests/system/checknames/ns4/named.conf.in
bin/tests/system/checknames/ns4/primary-ignore.update.db.in [moved from bin/tests/system/checknames/ns4/master-ignore.update.db.in with 100% similarity]
bin/tests/system/checknames/ns5/master-ignore.update.db.in [new file with mode: 0644]
bin/tests/system/checknames/ns5/named.conf.in [new file with mode: 0644]
bin/tests/system/checknames/ns5/root.hints [new file with mode: 0644]
bin/tests/system/checknames/setup.sh
bin/tests/system/checknames/tests.sh

index 1f439b08db3079a034a10f349b2fb953f3e42a69..9131a7f2c1c4c082a9f94120a0b3e6f51425c375 100644 (file)
@@ -17,6 +17,8 @@ rm -f ns1/*.update.db
 rm -f ns1/*.update.db.jnl
 rm -f ns4/*.update.db
 rm -f ns4/*.update.db.jnl
+rm -f ns5/*.update.db
+rm -f ns5/*.update.db.jnl
 rm -f */named.memstats
 rm -f */named.run
 rm -f ns*/named.lock
index 9043dbd38104489e7525611504f90a1fc2f7c880..dd6e8fd1a17dc3b2daa1030a4fc1b3579fb0ccfb 100644 (file)
@@ -28,8 +28,8 @@ zone "." {
        file "root.hints";
 };
 
-zone "master-ignore.update" {
+zone "primary-ignore.update" {
        type primary;
-       file "master-ignore.update.db";
+       file "primary-ignore.update.db";
        allow-update { any; };
 };
diff --git a/bin/tests/system/checknames/ns5/master-ignore.update.db.in b/bin/tests/system/checknames/ns5/master-ignore.update.db.in
new file mode 100644 (file)
index 0000000..f7864ab
--- /dev/null
@@ -0,0 +1,14 @@
+; 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
+@      SOA ns1.ignore.update. hostmaster.ignore.update. (
+           1 3600 1200 604800 3600 )
+       NS  ns1.ignore.update.
+ns1.ignore.update. A 10.53.0.1
diff --git a/bin/tests/system/checknames/ns5/named.conf.in b/bin/tests/system/checknames/ns5/named.conf.in
new file mode 100644 (file)
index 0000000..51344b5
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+options {
+       query-source address 10.53.0.5;
+       notify-source 10.53.0.5;
+       transfer-source 10.53.0.5;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.5; };
+       listen-on-v6 { none; };
+       recursion yes;
+       dnssec-validation yes;
+       check-names master ignore;
+       notify yes;
+};
+
+zone "." {
+       type hint;
+       file "root.hints";
+};
+
+zone "master-ignore.update" {
+       type primary;
+       file "master-ignore.update.db";
+       allow-update { any; };
+};
diff --git a/bin/tests/system/checknames/ns5/root.hints b/bin/tests/system/checknames/ns5/root.hints
new file mode 100644 (file)
index 0000000..962d33d
--- /dev/null
@@ -0,0 +1,12 @@
+; 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
+. NS  ns1.
+ns1. A 10.53.0.1
index 56ac92590c9bcf19b556ebd679ba138e637d7765..0aadd45d422152bf022743df6315fa6471bc2da7 100644 (file)
@@ -16,6 +16,7 @@ copy_setports ns1/named.conf.in ns1/named.conf
 copy_setports ns2/named.conf.in ns2/named.conf
 copy_setports ns3/named.conf.in ns3/named.conf
 copy_setports ns4/named.conf.in ns4/named.conf
+copy_setports ns5/named.conf.in ns5/named.conf
 
 cp ns1/ignore.example.db.in ns1/ignore.example.db
 cp ns1/warn.example.db.in ns1/warn.example.db
@@ -25,4 +26,6 @@ cp ns1/ignore.update.db.in ns1/ignore.update.db
 cp ns1/warn.update.db.in ns1/warn.update.db
 cp ns1/fail.update.db.in ns1/fail.update.db
 
-cp ns4/master-ignore.update.db.in ns4/master-ignore.update.db
+cp ns4/primary-ignore.update.db.in ns4/primary-ignore.update.db
+
+cp ns5/master-ignore.update.db.in ns5/master-ignore.update.db
index 8cf77fc7b7b445f4fb479af6abff315f2f911a5e..0ab333ce7b5fd7640348d0ef537ee5189c5099ab 100644 (file)
@@ -133,16 +133,33 @@ not=1
 $NSUPDATE -d <<END > nsupdate.out.test$n 2>&1 || ret=1
 check-names off
 server 10.53.0.4 ${PORT}
-update add xxx_xxx.master-ignore.update. 600 A 10.10.10.1
+update add xxx_xxx.primary-ignore.update. 600 A 10.10.10.1
 send
 END
-grep "xxx_xxx.master-ignore.update/A.*(check-names)" ns1/named.run > /dev/null || not=0
+grep "xxx_xxx.primary-ignore.update/A.*(check-names)" ns4/named.run > /dev/null || not=0
 if [ $not != 0 ]; then ret=1; fi
-$DIG $DIGOPTS xxx_xxx.master-ignore.update @10.53.0.4 A > dig.out.ns4.test$n || ret=1
+$DIG $DIGOPTS xxx_xxx.primary-ignore.update @10.53.0.4 A > dig.out.ns4.test$n || ret=1
 grep NOERROR dig.out.ns4.test$n > /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
+not=1
+$NSUPDATE -d <<END > nsupdate.out.test$n 2>&1 || ret=1
+check-names off
+server 10.53.0.5 ${PORT}
+update add xxx_xxx.master-ignore.update. 600 A 10.10.10.1
+send
+END
+grep "xxx_xxx.master-ignore.update/A.*(check-names)" ns5/named.run > /dev/null || not=0
+if [ $not != 0 ]; then ret=1; fi
+$DIG $DIGOPTS xxx_xxx.master-ignore.update @10.53.0.5 A > dig.out.ns5.test$n || ret=1
+grep NOERROR dig.out.ns5.test$n > /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