]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a system test for [GL #3777]
authorAram Sargsyan <aram@isc.org>
Fri, 27 Jan 2023 09:22:11 +0000 (09:22 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 27 Feb 2023 10:06:32 +0000 (10:06 +0000)
Add the 'ixfr-from-differences yes;' option to trigger a failed
zone postload operation when a zone is updated but the serial
number is not updated, then issue two successive 'rndc reload'
commands to trigger the bug, which causes an assertion failure.

bin/tests/system/catz/clean.sh
bin/tests/system/catz/ns4/catalog.example.db.in [new file with mode: 0644]
bin/tests/system/catz/ns4/named.conf.in
bin/tests/system/catz/setup.sh
bin/tests/system/catz/tests.sh

index 40a348aa0b9a7aa39ba6bc03d737af6686dfc03b..21dbc752c1169607900c769e067571e0de46c4c3 100644 (file)
@@ -29,6 +29,7 @@ rm -f ns2/catalog-bad*.db
 rm -f ns2/named.conf.tmp
 rm -f ns3/dom2.example.db ns3/dom13.example.db ns3/dom14.example.db ns3/dom17.example.db ns3/dom18.example.db
 rm -f ns4/__catz__*db
+rm -f ns4/catalog-self.example.db
 rm -f ns[123]/catalog[1234].example.db
 rm -f ns[14]/catalog-tls.example.db
 rm -f nsupdate.out.*
diff --git a/bin/tests/system/catz/ns4/catalog.example.db.in b/bin/tests/system/catz/ns4/catalog.example.db.in
new file mode 100644 (file)
index 0000000..a0bab0d
--- /dev/null
@@ -0,0 +1,14 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; SPDX-License-Identifier: MPL-2.0
+;
+; 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 https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+@ 3600 SOA . . 1 86400 3600 86400 3600
+@ 3600 IN NS invalid.
+version IN TXT "1"
index 22568365848dce11b579a0c281e79b9dab2e6d6a..73a2bb7b4903eae73a4fbc7e5897938b183453f7 100644 (file)
@@ -30,11 +30,15 @@ options {
        notify-delay 0;
        recursion no;
        serial-query-rate 100;
+       ixfr-from-differences yes; // GL #3777
 
        catalog-zones {
                zone "catalog-tls.example"
                        min-update-interval 1s
                        default-primaries { 10.53.0.1 key tsig_key tls ephemeral; };
+               zone "catalog-self.example"
+                       min-update-interval 1s
+                       default-primaries { 10.53.0.4; };
        };
 };
 
@@ -44,6 +48,12 @@ zone "catalog-tls.example" {
        primaries { 10.53.0.1 key tsig_key tls ephemeral; };
 };
 
+zone "catalog-self.example" {
+       type primary;
+       file "catalog-self.example.db";
+       notify explicit;
+};
+
 key tsig_key. {
        secret "LSAnCU+Z";
        algorithm @DEFAULT_HMAC@;
index ce1f931b1811a7010414a1976438dba329991990..eb2e53bd1a3af177a6cc51301e3b8aa5d1bf683c 100644 (file)
@@ -25,5 +25,6 @@ cp -f ns3/catalog.example.db.in ns3/catalog2.example.db
 cp -f ns1/catalog.example.db.in ns1/catalog3.example.db
 cp -f ns1/catalog.example.db.in ns1/catalog4.example.db
 cp -f ns1/catalog.example.db.in ns1/catalog-tls.example.db
+cp -f ns4/catalog.example.db.in ns4/catalog-self.example.db
 
 mkdir -p ns2/zonedir
index 9cb167b31dc297ef7bbd63cfb657c90913ac5364..a0ed0533beea3b16129f1f1e4e3225dd0f952934 100644 (file)
@@ -2605,5 +2605,23 @@ wait_for_soa @10.53.0.4 tls1.example. dig.out.test$n || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
+##########################################################################
+# GL #3777
+nextpart ns4/named.run >/dev/null
+
+n=$((n+1))
+echo_i "Adding domain self.example. to catalog-self zone without updating the serial ($n)"
+ret=0
+echo "self.zones.catalog-self.example. 3600 IN PTR self.example." >> ns4/catalog-self.example.db
+rndccmd 10.53.0.4 reload || ret=1
+
+n=$((n+1))
+echo_i "Issuing another rndc reload command after 1 second ($n)"
+sleep 1
+rndccmd 10.53.0.4 reload || ret=1
+if [ $ret -ne 0 ]; then echo_i "failed"; fi
+status=$((status+ret))
+
+##########################################################################
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1