]> 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)
committerAram Sargsyan <aram@isc.org>
Tue, 28 Feb 2023 14:40:17 +0000 (14:40 +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.

(cherry picked from commit a73b67456e8ed70040fd3dd0bda1d97210bb9536)

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 [new file with mode: 0644]
bin/tests/system/catz/setup.sh
bin/tests/system/catz/tests.sh

index fd8e9e4c3fbc26238c476755e9f8c4b0ffbd2995..b021f3baac24efab5bb30d9d431680df80c3288a 100644 (file)
@@ -23,6 +23,7 @@ rm -f ns1/*dom*example.db
 rm -f ns2/__catz__*db
 rm -f ns2/named.conf.tmp
 rm -f ns3/dom13.example.db ns3/dom14.example.db
+rm -f ns4/catalog-self.example.db
 rm -f nsupdate.out.*
 rm -f ns[123]/catalog[1234].example.db
 rm -rf ns2/zonedir
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"
diff --git a/bin/tests/system/catz/ns4/named.conf.in b/bin/tests/system/catz/ns4/named.conf.in
new file mode 100644 (file)
index 0000000..5f99308
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+include "../../common/rndc.key";
+
+controls {
+       inet 10.53.0.4 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+options {
+       query-source address 10.53.0.4;
+       notify-source 10.53.0.4;
+       transfer-source 10.53.0.4;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.4; };
+       listen-on-v6 { fd92:7065:b8e:ffff::4; };
+       notify no;
+       notify-delay 0;
+       recursion no;
+       serial-query-rate 100;
+       ixfr-from-differences yes; // GL #3777
+
+       catalog-zones {
+               zone "catalog-self.example"
+                       min-update-interval 1s
+                       default-masters { 10.53.0.4; };
+       };
+};
+
+zone "catalog-self.example" {
+       type primary;
+       file "catalog-self.example.db";
+       notify explicit;
+};
+
+key tsig_key. {
+       secret "LSAnCU+Z";
+       algorithm @DEFAULT_HMAC@;
+};
+
+key next_key. {
+       secret "LaAnCU+Z";
+       algorithm @DEFAULT_HMAC@;
+};
index ec3580b597d98f8ea4cdec7fdfef794b9f4e2855..d8ea17777746ead172ba266bc4cb8b105fe754db 100644 (file)
@@ -19,10 +19,12 @@ $SHELL clean.sh
 copy_setports ns1/named.conf.in ns1/named.conf
 copy_setports ns2/named1.conf.in ns2/named.conf
 copy_setports ns3/named.conf.in ns3/named.conf
+copy_setports ns4/named.conf.in ns4/named.conf
 
 cp -f ns1/catalog.example.db.in ns1/catalog1.example.db
 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 ns4/catalog.example.db.in ns4/catalog-self.example.db
 
 mkdir -p ns2/zonedir
index d85dfbbda77e8cd7fbeb785de05f4c2b37e7eaa9..e4e4f908dd75ee9fa07476099b70f0fdce726fc4 100644 (file)
@@ -1858,5 +1858,23 @@ wait_for_message ns2/named.run "transfer of 'dom19.example/IN' from 10.53.0.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