]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
update system tests to confirm new log messages
authorJINMEI Tatuya <jtatuya@infoblox.com>
Thu, 26 Sep 2024 08:04:57 +0000 (17:04 +0900)
committerMark Andrews <marka@isc.org>
Tue, 26 Nov 2024 05:39:48 +0000 (16:39 +1100)
bin/tests/system/ixfr/tests.sh
bin/tests/system/masterformat/tests.sh
bin/tests/system/nsupdate/ns1/named.conf.in
bin/tests/system/nsupdate/tests.sh
bin/tests/system/reclimit/tests.sh

index 97014200f23aca8e07f0370c8e4663e956b20735..ca5114723f437c4cac4f50b427e14ed2886cace6 100644 (file)
@@ -183,6 +183,11 @@ $DIG $DIGOPTS @10.53.0.1 nil. TXT | grep 'AXFR on too many records' >/dev/null |
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+msg="error adding 'nil/TXT' in 'nil/IN' (zone): too many records (must not exceed 5)"
+wait_for_log 10 "$msg" ns1/named.run || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 n=$((n + 1))
 echo_i "testing AXFR fallback after IXFR failure (bad SOA owner) ($n)"
 ret=0
index e103e328c82828aa89f745de0003d06f96093b8e..cbf52157e7406fabb46be1f91716d3a23da95933 100755 (executable)
@@ -315,6 +315,14 @@ n=$((n + 1))
 [ $ret -eq 0 ] || echo_i "failed"
 status=$((status + ret))
 
+# Check that the corresponding log message about exceeding the limit is present.
+msg="error adding '2100-txt.above-limit/TXT' in 'above-limit/IN' (zone): too many records (must not exceed 2050)"
+wait_for_log 10 "$msg" ns1/named.run || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+# Prepare for any further checking of the logs later on.
+nextpart ns1/named.run >/dev/null
+
 echo_i "checking that kasp-max-records-per-type rdatasets loaded ($n)"
 for _attempt in 0 1 2 3 4 5 6 7 8 9; do
   ret=0
index 2c173bd5f2e8877a1e2a4c5df23f998e91a8a926..56d95f5c1fbe61c0a9748f99f67bb1552e14be56 100644 (file)
@@ -80,6 +80,7 @@ zone "max-ttl.nil" {
        check-integrity no;
        allow-update { named-acl; };
        allow-transfer { any; };
+       max-records-per-type 3;
 };
 
 zone "other.nil" {
index 334163ec5301d0596583c26311a737a63624af0b..035d44d03783bca6599693cdc4f30689ef08ec1d 100755 (executable)
@@ -1644,6 +1644,27 @@ if [ $ret -ne 0 ]; then
   status=1
 fi
 
+n=$((n + 1))
+echo_i "check adding more records than max-records-per-type fails ($n)"
+ret=0
+$NSUPDATE <<END >nsupdate.out.test$n 2>&1 && ret=1
+server 10.53.0.1 ${PORT}
+zone max-ttl.nil.
+update add a.max-ttl.nil. 60 IN A 192.0.2.1
+update add a.max-ttl.nil. 60 IN A 192.0.2.2
+update add a.max-ttl.nil. 60 IN A 192.0.2.3
+update add a.max-ttl.nil. 60 IN A 192.0.2.4
+send
+END
+grep "update failed: SERVFAIL" nsupdate.out.test$n >/dev/null || ret=1
+msg="error updating 'a.max-ttl.nil/A' in 'max-ttl.nil/IN' (zone): too many records (must not exceed 3)"
+wait_for_log 10 "$msg" ns1/named.run || ret=1
+[ $ret = 0 ] || {
+  echo_i "failed"
+  status=1
+}
+nextpart ns1/named.run >/dev/null
+
 n=$((n + 1))
 ret=0
 echo_i "add a record which is truncated when logged. ($n)"
index 4d9105e62e8387d7f7f53ea02d57455dd317c723..8cc8fe122a3320a56268c817fc24dabffe62f385 100644 (file)
@@ -233,6 +233,12 @@ echo_i "checking RRset that exceeds max-records-per-type ($n)"
 ret=0
 dig_with_opts @10.53.0.3 biganswer.big >dig.out.1.test$n || ret=1
 grep 'status: SERVFAIL' dig.out.1.test$n >/dev/null || ret=1
+
+msg="error adding 'biganswer.big/A' in './IN' (cache): too many records (must not exceed 100)"
+wait_for_log 10 "$msg" ns3/named.run || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 ns3_reset ns3/named5.conf.in
 dig_with_opts @10.53.0.3 biganswer.big >dig.out.2.test$n || ret=1
 grep 'status: NOERROR' dig.out.2.test$n >/dev/null || ret=1