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 index 0000000000..252925f8dc --- /dev/null +++ b/bin/tests/system/xfer/ns1/axfr-min-transfer-rate.db @@ -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-$ diff --git a/bin/tests/system/xfer/ns1/named1.conf.in b/bin/tests/system/xfer/ns1/named1.conf.in index 990c911580..709187eff6 100644 --- a/bin/tests/system/xfer/ns1/named1.conf.in +++ b/bin/tests/system/xfer/ns1/named1.conf.in @@ -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; diff --git a/bin/tests/system/xfer/ns1/named2.conf.in b/bin/tests/system/xfer/ns1/named2.conf.in index 3c7f2fae20..aec68f3d1a 100644 --- a/bin/tests/system/xfer/ns1/named2.conf.in +++ b/bin/tests/system/xfer/ns1/named2.conf.in @@ -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"; diff --git a/bin/tests/system/xfer/ns6/named.conf.in b/bin/tests/system/xfer/ns6/named.conf.in index d6edf8a8a4..6a51f6e82d 100644 --- a/bin/tests/system/xfer/ns6/named.conf.in +++ b/bin/tests/system/xfer/ns6/named.conf.in @@ -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' diff --git a/bin/tests/system/xfer/tests.sh b/bin/tests/system/xfer/tests.sh index a8bca3dc3a..8098da23d6 100755 --- a/bin/tests/system/xfer/tests.sh +++ b/bin/tests/system/xfer/tests.sh @@ -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)) diff --git a/bin/tests/system/xfer/tests_sh_xfer.py b/bin/tests/system/xfer/tests_sh_xfer.py index 50efbca298..0b82e0bf12 100644 --- a/bin/tests/system/xfer/tests_sh_xfer.py +++ b/bin/tests/system/xfer/tests_sh_xfer.py @@ -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",