]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add test for not-loading and not-transfering huge RRSets
authorOndřej Surý <ondrej@isc.org>
Thu, 23 May 2024 17:12:40 +0000 (19:12 +0200)
committerNicki Křížek <nicki@isc.org>
Mon, 10 Jun 2024 16:50:05 +0000 (18:50 +0200)
Add two new masterformat tests - the 'huge' zone fits within the ns1
limit and loads on the primary ns1 server, but must not transfer to the
ns2 secondary, and the 'uber' zone should not even load on the primary
ns1 server.

(cherry picked from commit cee9ad81db6e5a1167b311e5c2f42cf65ba457cd)

bin/tests/system/doth/ns1/named.conf.in
bin/tests/system/limits/ns1/named.conf.in
bin/tests/system/masterformat/ns1/compile.sh
bin/tests/system/masterformat/ns1/huge.db.in [new file with mode: 0644]
bin/tests/system/masterformat/ns1/named.conf.in
bin/tests/system/masterformat/ns1/uber.db.in [new file with mode: 0644]
bin/tests/system/masterformat/ns2/named.conf.in
bin/tests/system/masterformat/setup.sh
bin/tests/system/masterformat/tests.sh

index 6a8bcdbda5d86b6e57d2300cef581bb4d9e35914..e302fbcbe7393d29261eeed2c9121da175b8a000 100644 (file)
@@ -98,6 +98,7 @@ options {
        tcp-initial-timeout 1200;
        transfers-in 100;
        transfers-out 100;
+       max-records-per-type 0;
 };
 
 zone "." {
index 780f9e21cbaa5a1e85dae539ee62dafef53a5a0b..2332acf1f15840908df1c2b8966687646d8698af 100644 (file)
@@ -23,6 +23,7 @@ options {
        notify yes;
        minimal-responses no;
        dnssec-validation no;
+       max-records-per-type 0;
 };
 
 zone "." {
index 9ea1740ae21c039226ddaeea6c076cdf1c6a8262..7b2ff56b2fb0879858e840afec1083a265a9f5c0 100755 (executable)
@@ -27,6 +27,8 @@ $CHECKZONE -D -F raw=0 -o example.db.compat example-compat \
 $CHECKZONE -D -F raw -L 3333 -o example.db.serial.raw example \
   example.db >/dev/null 2>&1
 $CHECKZONE -D -F raw -o large.db.raw large large.db >/dev/null 2>&1
+$CHECKZONE -D -F raw -o huge.db.raw huge huge.db >/dev/null 2>&1
+$CHECKZONE -D -F raw -o uber.db.raw uber uber.db >/dev/null 2>&1
 
 $KEYGEN -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -f KSK signed >/dev/null 2>&1
 $KEYGEN -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" signed >/dev/null 2>&1
diff --git a/bin/tests/system/masterformat/ns1/huge.db.in b/bin/tests/system/masterformat/ns1/huge.db.in
new file mode 100644 (file)
index 0000000..5a81863
--- /dev/null
@@ -0,0 +1,22 @@
+; 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 1D
+
+@                      IN SOA  ns hostmaster (
+                               1
+                               3600
+                               1800
+                               1814400
+                               3
+                               )
+                       NS      ns
+ns                     A       10.53.0.1
index a0d054fc6e00fdfd4ac8a03041d4dd68ce33a693..656d4c47169fe84a5dd7e6d122254fbabf04953d 100644 (file)
@@ -23,6 +23,7 @@ options {
        session-keyfile "session.key";
        servfail-ttl 0;
        dnssec-validation no;
+       max-records-per-type 2050;
 };
 
 key rndc_key {
@@ -78,6 +79,20 @@ zone "large" {
        allow-transfer { any; };
 };
 
+zone "huge" {
+       type primary;
+       file "huge.db.raw";
+       masterfile-format raw;
+       allow-transfer { any; };
+};
+
+zone "uber" {
+       type primary;
+       file "uber.db.raw";
+       masterfile-format raw;
+       allow-transfer { any; };
+};
+
 zone "signed" {
        type primary;
        file "signed.db.raw";
diff --git a/bin/tests/system/masterformat/ns1/uber.db.in b/bin/tests/system/masterformat/ns1/uber.db.in
new file mode 100644 (file)
index 0000000..5a81863
--- /dev/null
@@ -0,0 +1,22 @@
+; 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 1D
+
+@                      IN SOA  ns hostmaster (
+                               1
+                               3600
+                               1800
+                               1814400
+                               3
+                               )
+                       NS      ns
+ns                     A       10.53.0.1
index db68aef4d0687bb1397eee46cd2f3d3b0534fe91..1b28b0cb0e1e49430c51bf901fe7bdfa2f8cc3e5 100644 (file)
@@ -22,6 +22,7 @@ options {
        notify no;
        servfail-ttl 0;
        dnssec-validation no;
+       max-records-per-type 2000;
 };
 
 zone "example" {
@@ -62,3 +63,10 @@ zone "large" {
        masterfile-format raw;
        file "large.bk";
 };
+
+zone "huge" {
+       type secondary;
+       primaries { 10.53.0.1; };
+       masterfile-format raw;
+       file "huge.bk";
+};
index c2bc0f646c31426bd8dbe27b7a302c3172f04f2a..cc90f5a692872684c83ba651bfda122454f09777 100755 (executable)
@@ -24,8 +24,23 @@ cp ns1/example.db ns2/
 cp ns2/formerly-text.db.in ns2/formerly-text.db
 cp ns1/large.db.in ns1/large.db
 awk 'END {
-        for (i = 0; i < 512; i++ ) { print "a TXT", i; }
-        for (i = 0; i < 1024; i++ ) { print "b TXT", i; }
+        for (i = 0; i < 500; i++ ) { print "a TXT", i; }
+        for (i = 0; i < 1000; i++ ) { print "b TXT", i; }
         for (i = 0; i < 2000; i++ ) { print "c TXT", i; }
 }' </dev/null >>ns1/large.db
+cp ns1/huge.db.in ns1/huge.db
+awk 'END {
+        for (i = 0; i < 500; i++ ) { print "a TXT", i; }
+        for (i = 0; i < 1000; i++ ) { print "b TXT", i; }
+        for (i = 0; i < 2000; i++ ) { print "c TXT", i; }
+        for (i = 0; i < 2050; i++ ) { print "d TXT", i; }
+}' </dev/null >>ns1/huge.db
+cp ns1/uber.db.in ns1/uber.db
+awk 'END {
+        for (i = 0; i < 500; i++ ) { print "a TXT", i; }
+        for (i = 0; i < 1000; i++ ) { print "b TXT", i; }
+        for (i = 0; i < 2000; i++ ) { print "c TXT", i; }
+        for (i = 0; i < 2050; i++ ) { print "d TXT", i; }
+        for (i = 0; i < 2100; i++ ) { print "e TXT", i; }
+}' </dev/null >>ns1/uber.db
 cd ns1 && $SHELL compile.sh
index feb2a7502f9b309d978970166de15302741bedee..27d37a3ff35492140209f5865bfe4f44e84bcf30 100755 (executable)
@@ -177,8 +177,64 @@ echo_i "checking that large rdatasets loaded ($n)"
 for i in 0 1 2 3 4 5 6 7 8 9; do
   ret=0
   for a in a b c; do
-    $DIG +tcp txt "${a}.large" @10.53.0.2 -p "${PORT}" >"dig.out.ns2.test$n"
-    grep "status: NOERROR" "dig.out.ns2.test$n" >/dev/null || ret=1
+    $DIG +tcp txt "${a}.large" @10.53.0.1 -p "${PORT}" >"dig.out.ns1.$a.test$n"
+    grep "status: NOERROR" "dig.out.ns1.$a.test$n" >/dev/null || ret=1
+  done
+  [ $ret -eq 0 ] && break
+  sleep 1
+done
+n=$((n + 1))
+[ $ret -eq 0 ] || echo_i "failed"
+status=$((status + ret))
+
+echo_i "checking that large rdatasets transfered ($n)"
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  ret=0
+  for a in a b c; do
+    $DIG +tcp txt "${a}.large" @10.53.0.2 -p "${PORT}" >"dig.out.ns2.$a.test$n"
+    grep "status: NOERROR" "dig.out.ns2.$a.test$n" >/dev/null || ret=1
+  done
+  [ $ret -eq 0 ] && break
+  sleep 1
+done
+n=$((n + 1))
+[ $ret -eq 0 ] || echo_i "failed"
+status=$((status + ret))
+
+echo_i "checking that huge rdatasets loaded ($n)"
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  ret=0
+  for a in a b c d; do
+    $DIG +tcp txt "${a}.huge" @10.53.0.1 -p "${PORT}" >"dig.out.ns1.$a.test$n"
+    grep "status: NOERROR" "dig.out.ns1.$a.test$n" >/dev/null || ret=1
+  done
+  [ $ret -eq 0 ] && break
+  sleep 1
+done
+n=$((n + 1))
+[ $ret -eq 0 ] || echo_i "failed"
+status=$((status + ret))
+
+echo_i "checking that huge rdatasets not transfered ($n)"
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  ret=0
+  for a in a b c d; do
+    $DIG +tcp txt "${a}.huge" @10.53.0.2 -p "${PORT}" >"dig.out.ns2.$a.test$n"
+    grep "status: SERVFAIL" "dig.out.ns2.$a.test$n" >/dev/null || ret=1
+  done
+  [ $ret -eq 0 ] && break
+  sleep 1
+done
+n=$((n + 1))
+[ $ret -eq 0 ] || echo_i "failed"
+status=$((status + ret))
+
+echo_i "checking that uber rdatasets not loaded ($n)"
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  ret=0
+  for a in a b c d e; do
+    $DIG +tcp txt "${a}.uber" @10.53.0.1 -p "${PORT}" >"dig.out.ns1.$a.test$n"
+    grep "status: SERVFAIL" "dig.out.ns1.$a.test$n" >/dev/null || ret=1
   done
   [ $ret -eq 0 ] && break
   sleep 1