]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a catz system test check for [GL #3911]
authorAram Sargsyan <aram@isc.org>
Wed, 1 Mar 2023 12:47:25 +0000 (12:47 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 1 Mar 2023 15:49:21 +0000 (15:49 +0000)
The trick is to configure a duplicate zone, which comes after the
catalog zone, where the duplicate zone is an existing member zone.

In that scenario, all the zones which come before the "faulty" zone
in the configuration file will fail to be reverted to the previous
version of the view after a reconfiguration error, and in this
particular case that will result in an assertion failure when the
catalog zone update is initiated, because it will be still tied to
the new version of the view, which was dismissed.

(cherry picked from commit 93c4f382f4a8a4d049cdcae5971412667a7bade9)

bin/tests/system/catz/ns2/named1.conf.in
bin/tests/system/catz/tests.sh

index 14cb8e01462bc2de153d73d2bb5f5abaa12193e1..38381eb2e7e06109c7f6049350235adc378431d5 100644 (file)
@@ -47,7 +47,7 @@ options {
 };
 
 # A faulty dlz configuration to check if named and catz survive a certain class
-# of failed configuration attempts (see GL#3060).
+# of failed configuration attempts (see GL #3060).
 # We use "dlz" because the dlz processing code is located in an ideal place in
 # the view configuration function for the test to cover the view reverting code.
 #T3dlz "bad-dlz" {
@@ -78,6 +78,15 @@ zone "catalog4.example" {
        primaries { 10.53.0.1; };
 };
 
+# When the following zone configuration is enabled, "dom3.example" should
+# already exist as a member of "catalog1.example", and named should be able
+# to deal with that situation (see GL #3911). Make sure that this duplicate
+# zone comes after the the "catalog1.example" zone in the configuration file.
+#T4zone "dom3.example" {
+#T4    type secondary;
+#T4    file "dom2.example.db";
+#T4};
+
 key tsig_key. {
        secret "LSAnCU+Z";
        algorithm @DEFAULT_HMAC@;
index e4e4f908dd75ee9fa07476099b70f0fdce726fc4..69b3a5772fd427da96701b954a7d7f63db303984 100644 (file)
@@ -373,6 +373,9 @@ wait_for_soa @10.53.0.2 dom3.example. dig.out.test$n || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
+nextpart ns2/named.run >/dev/null
+
+# GL #3060
 n=$((n+1))
 echo_i "reconfiguring secondary - checking if catz survives a certain class of failed reconfiguration attempts ($n)"
 ret=0
@@ -397,6 +400,38 @@ rndccmd 10.53.0.2 reconfig || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
+nextpart ns2/named.run >/dev/null
+
+# GL #3911
+n=$((n+1))
+echo_i "reconfiguring secondary - checking if catz survives another type of failed reconfiguration attempts ($n)"
+ret=0
+sed -e "s/^#T4//" < 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 "${CONTROLPORT}" reconfig > /dev/null 2>&1 && ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status+ret))
+
+# catalog zone update can be deferred
+sleep 2
+
+n=$((n+1))
+echo_i "checking again that dom3.example. is served by secondary ($n)"
+ret=0
+wait_for_soa @10.53.0.2 dom3.example. dig.out.test$n || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status+ret))
+
+n=$((n+1))
+echo_i "reconfiguring secondary - reverting the bad configuration ($n)"
+ret=0
+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))
+
+nextpart ns2/named.run >/dev/null
+
 n=$((n+1))
 echo_i "removing all records from catalog1 zone ($n)"
 ret=0