]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check for proper file size output in dnstap test
authorTom Krizek <tkrizek@isc.org>
Thu, 22 Jun 2023 16:08:17 +0000 (18:08 +0200)
committerTom Krizek <tkrizek@isc.org>
Thu, 22 Jun 2023 17:19:08 +0000 (19:19 +0200)
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

index 9e28c956895761380bb6ad056bca68a6a3a68cb3..5936657d5a38397aa0da15a5ead3c128c91b4414 100644 (file)
@@ -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`