]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test trying of the next primary server
authorAram Sargsyan <aram@isc.org>
Tue, 26 Nov 2024 12:09:57 +0000 (12:09 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 27 Nov 2024 10:37:13 +0000 (10:37 +0000)
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.

bin/tests/system/xfer/ns1/named1.conf.in
bin/tests/system/xfer/ns1/xot-primary-try-next.db [new file with mode: 0644]
bin/tests/system/xfer/ns6/named.conf.in
bin/tests/system/xfer/tests.sh
bin/tests/system/xfer/tests_sh_xfer.py

index c7e844964ece25bb656b6fa26ede8a7a0742cf5f..990c911580fb8d1d6c79a29cdac765fd21c96563 100644 (file)
@@ -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 (file)
index 0000000..dd9ed5d
--- /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.
+
+$TTL   3600
+@      IN      SOA     . . 0 0 0 0 0
+@      IN      NS      .
index ea14584985a45081af9ff941aa5e5ab515f6d24a..d6edf8a8a416fec3e6d78de9f7dc41f852de9f23 100644 (file)
@@ -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;
index cb67e40547853efadc1ca3951f7f882b74c47626..a8bca3dc3a6d3fba4189397fdc343d074ab80b77 100755 (executable)
@@ -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
index d217b0becf484a29e22cd0fce42ae91a8ecc4718..50efbca2981cbc13b4430b10d8eea7f1843fcdb9 100644 (file)
@@ -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",