]> 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)
committerOndřej Surý <ondrej@isc.org>
Mon, 29 Jul 2024 09:27:54 +0000 (11:27 +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/limits/ns1/named.conf.in
bin/tests/system/masterformat/clean.sh
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 118fdbd9b194840d4ca625321d2d3b048dd603bb..cf0aa783b114efc0c102ee8c40aa279ad4062236 100644 (file)
@@ -22,6 +22,7 @@ options {
        recursion no;
        notify yes;
        minimal-responses no;
+       max-records-per-type 0;
 };
 
 zone "." {
index c53c7ab4bcf5cb0269d410fc8d71367a4bf09dd5..c606c6183ac2d1815188818984577cdbcc8c255b 100755 (executable)
@@ -16,6 +16,8 @@ rm -f ./ns1/example.db.compat
 rm -f ./ns1/example.db.serial.raw
 rm -f ./ns1/large.db ./ns1/large.db.raw
 rm -f ./ns1/example.db.map ./ns1/signed.db.map
+rm -f ./ns1/huge.db ./ns1/huge.db.raw
+rm -f ./ns1/uber.db ./ns1/uber.db.raw
 rm -f ./ns1/session.key
 rm -f ./dig.out.*
 rm -f ./dig.out
index ad24bb320139197d42c23f98f0e3ca0151e75161..34279547a07d7295e67bed528e8f151f530662bb 100755 (executable)
@@ -29,6 +29,8 @@ $CHECKZONE -D -F raw -L 3333 -o example.db.serial.raw example \
 $CHECKZONE -D -F raw -o large.db.raw large large.db >/dev/null 2>&1
 $CHECKZONE -D -F map -o example.db.map example-map \
   example.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 cc956556917d5aa926b62b42825eae73e358f205..1434ec34d6e38169bc5e7c93cbea1cc5e54a689a 100644 (file)
@@ -22,6 +22,7 @@ options {
        notify no;
        session-keyfile "session.key";
        servfail-ttl 0;
+       max-records-per-type 2050;
 };
 
 key rndc_key {
@@ -77,6 +78,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.map";
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 c0f29873181225571761b3f3155c95508758c873..df778bc64ba11f9aa92c55650bdde07117652703 100644 (file)
@@ -21,6 +21,7 @@ options {
        recursion no;
        notify no;
        servfail-ttl 0;
+       max-records-per-type 2000;
 };
 
 zone "example" {
@@ -61,3 +62,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 f3042428bd45653717301d2db45de4a91d9266fc..57b8a249522692d8a3ea0a2679ed056089c6913f 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 3a4eb3e1160760c0be4ae063a7c0ed907fa9bf30..f88916d274b85a09f2710f2d3b5f3bb33a081eb9 100755 (executable)
@@ -188,8 +188,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