From 1dd4c2b9e2649f8dc41335e15180c0dc5ad4efbb Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Thu, 22 Jun 2023 17:57:22 +0200 Subject: [PATCH 1/2] Check for proper log message in kasp test The log message is supposed to contain the zone name which was erroneously omitted, but didn't pop up during tests, since return code was silently ignored. Now it actually waits for the proper log message rather than being an equivalent of 3 second sleep (which was also sufficient to make the test pass, thus we detected no failure). --- bin/tests/system/kasp/tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tests/system/kasp/tests.sh b/bin/tests/system/kasp/tests.sh index 9766c380c8..8378feff72 100644 --- a/bin/tests/system/kasp/tests.sh +++ b/bin/tests/system/kasp/tests.sh @@ -328,7 +328,7 @@ ret=0 nextpart $DIR/named.run > /dev/null rndccmd 10.53.0.3 loadkeys "$ZONE" > /dev/null || log_error "rndc loadkeys zone ${ZONE} failed" -wait_for_log 3 "keymgr: done" $DIR/named.run +wait_for_log 3 "keymgr: $ZONE done" $DIR/named.run privkey_stat2=$(key_stat "${basefile}.private") pubkey_stat2=$(key_stat "${basefile}.key") state_stat2=$(key_stat "${basefile}.state") From 5f809e50b6a8441592fdf6d0fd8aa69668a25439 Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Thu, 22 Jun 2023 18:08:17 +0200 Subject: [PATCH 2/2] Check for proper file size output in dnstap test Previously, the first check silently failed, as 454 is apparently (in my local setup) the minimum output size for the dnstap output, rather than 470 which the test was expecting. Effectively, the check served as a 5 second sleep rather than waiting for the proper file size. Additionally, check the expected file sizes and fail if expectations aren't met. --- bin/tests/system/dnstap/tests.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/dnstap/tests.sh b/bin/tests/system/dnstap/tests.sh index 9e28c95689..5936657d5a 100644 --- a/bin/tests/system/dnstap/tests.sh +++ b/bin/tests/system/dnstap/tests.sh @@ -562,7 +562,12 @@ EOF echo_i "checking unix socket message counts" sleep 2 - retry_quiet 5 dnstap_data_ready $fstrm_capture_pid dnstap.out 470 + retry_quiet 5 dnstap_data_ready $fstrm_capture_pid dnstap.out 454 || { + echo_i "dnstap output file smaller than expected" + ret=1 + } + if [ $ret != 0 ]; then echo_i "failed"; fi + status=$((status + ret)) kill $fstrm_capture_pid wait udp4=`$DNSTAPREAD dnstap.out | grep "UDP " | wc -l` @@ -675,7 +680,12 @@ EOF echo_i "checking reopened unix socket message counts" sleep 2 - retry_quiet 5 dnstap_data_ready $fstrm_capture_pid dnstap.out 270 + retry_quiet 5 dnstap_data_ready $fstrm_capture_pid dnstap.out 270 || { + echo_i "dnstap output file smaller than expected" + ret=1 + } + if [ $ret != 0 ]; then echo_i "failed"; fi + status=$((status + ret)) kill $fstrm_capture_pid wait udp4=`$DNSTAPREAD dnstap.out | grep "UDP " | wc -l`