]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test the new min-transfer-rate-in configuration option
authorAram Sargsyan <aram@isc.org>
Mon, 10 Jun 2024 16:50:37 +0000 (16:50 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Thu, 20 Feb 2025 09:32:55 +0000 (09:32 +0000)
Add a new big zone, run a zone transfer in slow mode, and check
whether the zone transfer gets canceled because 100000 bytes are
not transferred in 5 seconds (as it's running in slow mode).

bin/tests/system/xfer/ns1/axfr-min-transfer-rate.db [new file with mode: 0644]
bin/tests/system/xfer/ns1/named1.conf.in
bin/tests/system/xfer/ns1/named2.conf.in
bin/tests/system/xfer/ns6/named.conf.in
bin/tests/system/xfer/tests.sh
bin/tests/system/xfer/tests_sh_xfer.py

diff --git a/bin/tests/system/xfer/ns1/axfr-min-transfer-rate.db b/bin/tests/system/xfer/ns1/axfr-min-transfer-rate.db
new file mode 100644 (file)
index 0000000..252925f
--- /dev/null
@@ -0,0 +1,15 @@
+; 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      .
+$GENERATE 1-5000       host$   TXT     data-$
index 990c911580fb8d1d6c79a29cdac765fd21c96563..709187eff6f9aafca17e64f65cdaccaf18b3c4f4 100644 (file)
@@ -47,6 +47,10 @@ zone "edns-expire" {
        file "edns-expire.db";
 };
 
+zone "axfr-min-transfer-rate" {
+       type primary;
+       file "axfr-min-transfer-rate.db";
+};
 
 zone "axfr-max-transfer-time" {
        type primary;
index 3c7f2fae2091fb8ddb03ea55e00b9147f0aaaa1d..aec68f3d1a6358a18796c9e14e7afa4e77807480 100644 (file)
@@ -36,6 +36,11 @@ zone "." {
        file "root.db";
 };
 
+zone "axfr-min-transfer-rate" {
+       type primary;
+       file "axfr-min-transfer-rate.db";
+};
+
 zone "axfr-max-transfer-time" {
        type primary;
        file "axfr-max-transfer-time.db";
index d6edf8a8a416fec3e6d78de9f7dc41f852de9f23..6a51f6e82d0616a0b30d0097921f35ac11bbcd11 100644 (file)
@@ -32,6 +32,7 @@ options {
        ixfr-from-differences primary;
        check-integrity no;
        tcp-idle-timeout 600;
+       min-transfer-rate-in 10240 300;  # this is tested as seconds, when used with '-T transferinsecs' (i.e. convert the default '10240 5' back so that it doesn't interfere with other tests)
 };
 
 zone "." {
@@ -57,6 +58,13 @@ zone "edns-expire" {
        file "edns-expire.bk";
 };
 
+zone "axfr-min-transfer-rate" {
+       type secondary;
+       min-transfer-rate-in 100000 5; # this is tested as seconds, when used with '-T transferinsecs' (i.e. 100000 bytes in 5 seconds)
+       primaries { 10.53.0.1; };
+       file "axfr-min-transfer-rate.bk";
+};
+
 zone "axfr-max-transfer-time" {
        type secondary;
        max-transfer-time-in 1; # this is tested as seconds, when used with '-T transferinsecs'
index a8bca3dc3a6d3fba4189397fdc343d074ab80b77..8098da23d62d31045de9d65d489d01eedd592e6b 100755 (executable)
@@ -709,11 +709,22 @@ status=$((status + tmp))
 
 nextpart ns6/named.run >/dev/null
 
+n=$((n + 1))
+echo_i "test min-transfer-rate-in with 5 seconds timeout ($n)"
+$RNDCCMD 10.53.0.6 retransfer axfr-min-transfer-rate 2>&1 | sed 's/^/ns6 /' | cat_i
+tmp=0
+retry_quiet 10 wait_for_message "minimum transfer rate reached: timed out" || 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 max-transfer-time-in with 1 second timeout ($n)"
 $RNDCCMD 10.53.0.6 retransfer axfr-max-transfer-time 2>&1 | sed 's/^/ns6 /' | cat_i
 tmp=0
 retry_quiet 10 wait_for_message "maximum transfer time exceeded: timed out" || tmp=1
+if test $tmp != 0; then echo_i "failed"; fi
 status=$((status + tmp))
 
 # Restart ns1 with -T transferstuck
@@ -730,6 +741,7 @@ start=$(date +%s)
 $RNDCCMD 10.53.0.6 retransfer axfr-max-idle-time 2>&1 | sed 's/^/ns6 /' | cat_i
 tmp=0
 retry_quiet 60 wait_for_message "maximum idle time exceeded: timed out" || tmp=1
+if test $tmp != 0; then echo_i "failed"; fi
 if [ $tmp -eq 0 ]; then
   now=$(date +%s)
   diff=$((now - start))
index 50efbca2981cbc13b4430b10d8eea7f1843fcdb9..0b82e0bf12e0dd11c0856dd176f23044e0b39a5d 100644 (file)
@@ -41,6 +41,7 @@ pytestmark = pytest.mark.extra_artifacts(
         "ns4/root.db",
         "ns6/axfr-max-idle-time.bk",
         "ns6/axfr-max-transfer-time.bk",
+        "ns6/axfr-min-transfer-rate.bk",
         "ns6/axfr-rndc-retransfer-force.bk",
         "ns6/edns-expire.bk",
         "ns6/ixfr-too-big.bk",