From 000720fe14266595ce37ad9ca692b28310f5a6f7 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Thu, 26 Sep 2024 17:04:57 +0900 Subject: [PATCH] update system tests to confirm new log messages --- bin/tests/system/ixfr/tests.sh | 5 +++++ bin/tests/system/masterformat/tests.sh | 8 ++++++++ bin/tests/system/nsupdate/ns1/named.conf.in | 1 + bin/tests/system/nsupdate/tests.sh | 21 +++++++++++++++++++++ bin/tests/system/reclimit/tests.sh | 6 ++++++ 5 files changed, 41 insertions(+) diff --git a/bin/tests/system/ixfr/tests.sh b/bin/tests/system/ixfr/tests.sh index 97014200f2..ca5114723f 100644 --- a/bin/tests/system/ixfr/tests.sh +++ b/bin/tests/system/ixfr/tests.sh @@ -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 diff --git a/bin/tests/system/masterformat/tests.sh b/bin/tests/system/masterformat/tests.sh index e103e328c8..cbf52157e7 100755 --- a/bin/tests/system/masterformat/tests.sh +++ b/bin/tests/system/masterformat/tests.sh @@ -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 diff --git a/bin/tests/system/nsupdate/ns1/named.conf.in b/bin/tests/system/nsupdate/ns1/named.conf.in index 2c173bd5f2..56d95f5c1f 100644 --- a/bin/tests/system/nsupdate/ns1/named.conf.in +++ b/bin/tests/system/nsupdate/ns1/named.conf.in @@ -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" { diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index 334163ec53..035d44d037 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -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 <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)" diff --git a/bin/tests/system/reclimit/tests.sh b/bin/tests/system/reclimit/tests.sh index 4d9105e62e..8cc8fe122a 100644 --- a/bin/tests/system/reclimit/tests.sh +++ b/bin/tests/system/reclimit/tests.sh @@ -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