]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a regression test
authorEvan Hunt <each@isc.org>
Mon, 11 Oct 2021 20:01:20 +0000 (13:01 -0700)
committerAram Sargsyan <aram@isc.org>
Wed, 1 Dec 2021 09:56:59 +0000 (09:56 +0000)
Reconfigure the server without catalog-zone configuration, and then
put it back and reconfigure again, to confirm that there's no crash.

(cherry picked from commit bb411af31dd78ceda7a16f7ecfab483fb3746af9)

bin/tests/system/catz/ns2/named1.conf.in [moved from bin/tests/system/catz/ns2/named.conf.in with 100% similarity]
bin/tests/system/catz/ns2/named2.conf.in [new file with mode: 0644]
bin/tests/system/catz/setup.sh
bin/tests/system/catz/tests.sh

diff --git a/bin/tests/system/catz/ns2/named2.conf.in b/bin/tests/system/catz/ns2/named2.conf.in
new file mode 100644 (file)
index 0000000..fcd99ca
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+include "../../common/rndc.key";
+
+controls {
+       inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+options {
+       query-source address 10.53.0.2;
+       notify-source 10.53.0.2;
+       transfer-source 10.53.0.2;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.2; };
+       listen-on-v6 { fd92:7065:b8e:ffff::2; };
+       notify no;
+       recursion no;
+       serial-query-rate 100;
+       # removed catalog-zone option, otherwise this is
+       # identical to named1.conf.in
+};
+
+zone "catalog1.example" {
+       type secondary;
+       file "catalog1.example.db";
+       primaries { 10.53.0.1; };
+};
+
+zone "catalog2.example" {
+       type secondary;
+       file "catalog2.example.db";
+       primaries { 10.53.0.3; };
+};
+
+zone "catalog3.example" {
+       type secondary;
+       file "catalog3.example.db";
+       primaries { 10.53.0.1; };
+};
+
+zone "catalog4.example" {
+       type secondary;
+       file "catalog4.example.db";
+       primaries { 10.53.0.1; };
+};
+
+key tsig_key. {
+       secret "LSAnCU+Z";
+       algorithm hmac-md5;
+};
index 960cffe9a78da2a888f8a0c7d54f13d55c42a081..e23ea4f05863966bc4efbc0e2ce2273c3d222bfa 100644 (file)
@@ -15,7 +15,7 @@ SYSTEMTESTTOP=..
 $SHELL clean.sh
 
 copy_setports ns1/named.conf.in ns1/named.conf
-copy_setports ns2/named.conf.in ns2/named.conf
+copy_setports ns2/named1.conf.in ns2/named.conf
 copy_setports ns3/named.conf.in ns3/named.conf
 
 cp -f ns1/catalog.example.db.in ns1/catalog1.example.db
index c443b739ff2fa77419a93b8d7ca39f50ff64fd7c..cd2084e59a636a0ac03345aec15736b1a9670208 100644 (file)
@@ -1179,7 +1179,7 @@ status=$((status+ret))
 n=$((n+1))
 echo_i "reconfiguring secondary - adding catalog4 catalog zone ($n)"
 ret=0
-sed -e "s/^#T1//g" <  ns2/named.conf.in > ns2/named.conf.tmp
+sed -e "s/^#T1//g" <  ns2/named1.conf.in > ns2/named.conf.tmp
 copy_setports ns2/named.conf.tmp ns2/named.conf
 rndccmd 10.53.0.2 reconfig || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -1210,7 +1210,7 @@ status=$((status+ret))
 n=$((n+1))
 echo_i "reconfiguring secondary - removing catalog4 catalog zone, adding non-existent catalog5 catalog zone ($n)"
 ret=0
-sed -e "s/^#T2//" < ns2/named.conf.in > ns2/named.conf.tmp
+sed -e "s/^#T2//" < ns2/named1.conf.in > ns2/named.conf.tmp
 copy_setports ns2/named.conf.tmp ns2/named.conf
 $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig > /dev/null 2>&1 && ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -1219,7 +1219,7 @@ status=$((status+ret))
 n=$((n+1))
 echo_i "reconfiguring secondary - removing non-existent catalog5 catalog zone ($n)"
 ret=0
-copy_setports ns2/named.conf.in ns2/named.conf
+copy_setports ns2/named1.conf.in ns2/named.conf
 rndccmd 10.53.0.2 reconfig || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
@@ -1730,5 +1730,15 @@ wait_for_no_soa @10.53.0.2 dom16.example. dig.out.test$n || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
+n=$((n+1))
+echo_i "checking that reconfig can delete and restore catalog zone configuration ($n)"
+ret=0
+copy_setports ns2/named2.conf.in ns2/named.conf
+rndccmd 10.53.0.2 reconfig || ret=1
+copy_setports ns2/named1.conf.in ns2/named.conf
+rndccmd 10.53.0.2 reconfig || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status+ret))
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1