]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test the 'request-ixfr-max-diffs' configuration option
authorAram Sargsyan <aram@isc.org>
Fri, 7 Jun 2024 14:49:59 +0000 (14:49 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Thu, 22 Aug 2024 13:42:27 +0000 (13:42 +0000)
Configure a maximum of 3 allowed differences and add 5 new records.
Check that named detected that the differences exceed the allowed
limit and successfully retries with AXFR.

bin/tests/system/xfer/ns1/ixfr-too-many-diffs.db [new file with mode: 0644]
bin/tests/system/xfer/ns1/named1.conf.in
bin/tests/system/xfer/ns6/named.conf.in
bin/tests/system/xfer/tests.sh

diff --git a/bin/tests/system/xfer/ns1/ixfr-too-many-diffs.db b/bin/tests/system/xfer/ns1/ixfr-too-many-diffs.db
new file mode 100644 (file)
index 0000000..c192316
--- /dev/null
@@ -0,0 +1,18 @@
+; 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      ns1
+@      IN      NS      ns6
+ns1    IN      A       10.53.0.1
+ns6    IN      A       10.53.0.6
+$GENERATE 1-25 host$   A       1.2.3.$
index d3f597dfda054f3e80c5dc0818a0d6ab6d7ae274..c7e844964ece25bb656b6fa26ede8a7a0742cf5f 100644 (file)
@@ -74,6 +74,12 @@ zone "ixfr-too-big" {
        file "ixfr-too-big.db";
 };
 
+zone "ixfr-too-many-diffs" {
+       type primary;
+       allow-update { any; };
+       file "ixfr-too-many-diffs.db";
+};
+
 zone "xfer-stats" {
        type primary;
        file "xfer-stats.db";
index e98fc3b58862aef2059438ff7e91a634ad0c32a8..ea14584985a45081af9ff941aa5e5ab515f6d24a 100644 (file)
@@ -90,3 +90,10 @@ zone "ixfr-too-big" {
        primaries { 10.53.0.1; };
        file "ixfr-too-big.bk";
 };
+
+zone "ixfr-too-many-diffs" {
+       type secondary;
+       request-ixfr-max-diffs 3;
+       primaries { 10.53.0.1; };
+       file "ixfr-too-many-diffs.bk";
+};
index feeb3a679f329d4897677a5d3ab5ebae230f8a9f..a379a6a705f8cb61f03795b09766dffe12e4c94c 100755 (executable)
@@ -591,6 +591,27 @@ wait_for_log 10 "$msg" ns6/named.run || tmp=1
 if test $tmp != 0; then echo_i "failed"; fi
 status=$((status + tmp))
 
+n=$((n + 1))
+echo_i "test that a zone with too many diffs (IXFR) is retried with AXFR ($n)"
+tmp=0
+nextpart ns6/named.run >/dev/null
+$NSUPDATE <<EOF
+zone ixfr-too-many-diffs
+server 10.53.0.1 ${PORT}
+update add the-31st-record.ixfr-too-many-diffs 0 TXT too
+update add the-32nd-record.ixfr-too-many-diffs 0 TXT many
+update add the-33rd-record.ixfr-too-many-diffs 0 TXT diffs
+update add the-34th-record.ixfr-too-many-diffs 0 TXT for
+update add the-35th-record.ixfr-too-many-diffs 0 TXT ixfr
+send
+EOF
+msg="'ixfr-too-many-diffs/IN' from 10.53.0.1#${PORT}: Transfer status: success"
+wait_for_log 10 "$msg" ns6/named.run || tmp=1
+msg="'ixfr-too-many-diffs/IN' from 10.53.0.1#${PORT}: too many diffs, retrying with AXFR"
+grep -F "$msg" ns6/named.run >/dev/null || tmp=1
+if test $tmp != 0; then echo_i "failed"; fi
+status=$((status + tmp))
+
 n=$((n + 1))
 echo_i "checking whether dig calculates AXFR statistics correctly ($n)"
 tmp=0