2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Test the new min-transfer-rate-in configuration option

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).
This commit is contained in:
Aram Sargsyan 2024-06-10 16:50:37 +00:00 committed by Arаm Sаrgsyаn
parent f6dfff01ab
commit b9c6aa24f8
6 changed files with 45 additions and 0 deletions

View File

@ -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-$

View 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;

View 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";

View 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'

View File

@ -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))

View 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",