From: Aram Sargsyan Date: Tue, 26 Nov 2024 12:09:57 +0000 (+0000) Subject: Test trying of the next primary server X-Git-Tag: v9.21.3~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12225d125bb7690fdf4a26536869a048874aa51d;p=thirdparty%2Fbind9.git Test trying of the next primary server Add test cases which check that when a XoT primary server is unreachable or is already marked as unreachble then the next primary server in the list is used. --- diff --git a/bin/tests/system/xfer/ns1/named1.conf.in b/bin/tests/system/xfer/ns1/named1.conf.in index c7e844964ec..990c911580f 100644 --- a/bin/tests/system/xfer/ns1/named1.conf.in +++ b/bin/tests/system/xfer/ns1/named1.conf.in @@ -63,6 +63,11 @@ zone "axfr-rndc-retransfer-force" { file "axfr-rndc-retransfer-force.db"; }; +zone "xot-primary-try-next" { + type primary; + file "xot-primary-try-next.db"; +}; + zone "axfr-too-big" { type primary; file "axfr-too-big.db"; diff --git a/bin/tests/system/xfer/ns1/xot-primary-try-next.db b/bin/tests/system/xfer/ns1/xot-primary-try-next.db new file mode 100644 index 00000000000..dd9ed5d29bd --- /dev/null +++ b/bin/tests/system/xfer/ns1/xot-primary-try-next.db @@ -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. + +$TTL 3600 +@ IN SOA . . 0 0 0 0 0 +@ IN NS . diff --git a/bin/tests/system/xfer/ns6/named.conf.in b/bin/tests/system/xfer/ns6/named.conf.in index ea14584985a..d6edf8a8a41 100644 --- a/bin/tests/system/xfer/ns6/named.conf.in +++ b/bin/tests/system/xfer/ns6/named.conf.in @@ -77,6 +77,12 @@ zone "axfr-rndc-retransfer-force" { file "axfr-rndc-retransfer-force.bk"; }; +zone "xot-primary-try-next" { + type secondary; + primaries { 10.53.0.99 port @EXTRAPORT1@ tls ephemeral; 10.53.0.1; }; + file "xot-primary-try-next.bk"; +}; + zone "axfr-too-big" { type secondary; max-records 30; diff --git a/bin/tests/system/xfer/tests.sh b/bin/tests/system/xfer/tests.sh index cb67e405478..a8bca3dc3a6 100755 --- a/bin/tests/system/xfer/tests.sh +++ b/bin/tests/system/xfer/tests.sh @@ -660,6 +660,28 @@ wait_for_message() ( grep -F "$1" wait_for_message.$n >/dev/null ) +nextpart ns6/named.run >/dev/null + +n=$((n + 1)) +echo_i "test that named tries the next primary in the list when the first one fails (XoT -> Do53) ($n)" +tmp=0 +$RNDCCMD 10.53.0.6 retransfer xot-primary-try-next 2>&1 | sed 's/^/ns6 /' | cat_i +msg="'xot-primary-try-next/IN' from 10.53.0.1#${PORT}: Transfer status: success" +retry_quiet 60 wait_for_message "$msg" || tmp=1 +if test $tmp != 0; then echo_i "failed"; fi +status=$((status + tmp)) + +nextpart ns6/named.run >/dev/null + +n=$((n + 1)) +echo_i "test that named tries the next primary in the list when the first one is already marked as unreachable (XoT -> Do53) ($n)" +tmp=0 +$RNDCCMD 10.53.0.6 retransfer xot-primary-try-next 2>&1 | sed 's/^/ns6 /' | cat_i +msg="'xot-primary-try-next/IN' from 10.53.0.1#${PORT}: Transfer status: success" +retry_quiet 60 wait_for_message "$msg" || tmp=1 +if test $tmp != 0; then echo_i "failed"; fi +status=$((status + tmp)) + # Restart ns1 with -T transferslowly stop_server ns1 copy_setports ns1/named2.conf.in ns1/named.conf diff --git a/bin/tests/system/xfer/tests_sh_xfer.py b/bin/tests/system/xfer/tests_sh_xfer.py index d217b0becf4..50efbca2981 100644 --- a/bin/tests/system/xfer/tests_sh_xfer.py +++ b/bin/tests/system/xfer/tests_sh_xfer.py @@ -49,6 +49,7 @@ pytestmark = pytest.mark.extra_artifacts( "ns6/primary.db", "ns6/primary.db.jnl", "ns6/sec.bk", + "ns6/xot-primary-try-next.bk", "ns7/edns-expire.bk", "ns7/primary2.db", "ns7/sec.bk",