From: Aram Sargsyan Date: Fri, 27 Jan 2023 09:22:11 +0000 (+0000) Subject: Add a system test for [GL #3777] X-Git-Tag: v9.19.11~20^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a73b67456e8ed70040fd3dd0bda1d97210bb9536;p=thirdparty%2Fbind9.git Add a system test for [GL #3777] 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. --- diff --git a/bin/tests/system/catz/clean.sh b/bin/tests/system/catz/clean.sh index 40a348aa0b9..21dbc752c11 100644 --- a/bin/tests/system/catz/clean.sh +++ b/bin/tests/system/catz/clean.sh @@ -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 index 00000000000..a0bab0dfe28 --- /dev/null +++ b/bin/tests/system/catz/ns4/catalog.example.db.in @@ -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 index 22568365848..73a2bb7b490 100644 --- a/bin/tests/system/catz/ns4/named.conf.in +++ b/bin/tests/system/catz/ns4/named.conf.in @@ -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@; diff --git a/bin/tests/system/catz/setup.sh b/bin/tests/system/catz/setup.sh index ce1f931b181..eb2e53bd1a3 100644 --- a/bin/tests/system/catz/setup.sh +++ b/bin/tests/system/catz/setup.sh @@ -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 diff --git a/bin/tests/system/catz/tests.sh b/bin/tests/system/catz/tests.sh index 9cb167b31dc..a0ed0533bee 100644 --- a/bin/tests/system/catz/tests.sh +++ b/bin/tests/system/catz/tests.sh @@ -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