]> 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>
Mon, 26 Jun 2023 12:33:43 +0000 (14:33 +0200)
Previously, the first check silently failed, as 450 is apparently (in
the CI) 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.

(manually picked from commit 5f809e50b6a8441592fdf6d0fd8aa69668a25439)

On main, the minimum file size seems to 454 bytes, while on some
platforms in our CI setup for the 9.16 branch, it appears to be 450
instead.

bin/tests/system/dnstap/tests.sh

index 0724a492874a331adf5f236474d6ba468ebc1595..11c2ceb9f0c398a308bcd027612e59487b19848c 100644 (file)
@@ -563,7 +563,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 450 || {
+               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`
@@ -676,7 +681,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`