From: Michał Kępień Date: Tue, 25 Jun 2019 12:30:16 +0000 (+0200) Subject: Wait for outgoing transfer statistics to be logged X-Git-Tag: v9.15.2~31^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9fc5e48b1410133273f7db7ac4425430140664c2;p=thirdparty%2Fbind9.git Wait for outgoing transfer statistics to be logged Since the message confirming outgoing transfer completion is logged asynchronously, it may happen that transfer statistics may not yet be logged by the time the dig command triggering a given transfer returns. This causes false positives for the "ixfr" and "xfer" system tests. Prevent this from happening by checking outgoing transfer statistics up to 10 times, in 1-second intervals. --- diff --git a/bin/tests/system/ixfr/tests.sh b/bin/tests/system/ixfr/tests.sh index 3f8a2ef4578..e14fbc028c3 100644 --- a/bin/tests/system/ixfr/tests.sh +++ b/bin/tests/system/ixfr/tests.sh @@ -364,9 +364,15 @@ status=$((status+ret)) n=$((n+1)) echo_i "checking whether named calculates outgoing IXFR statistics correctly ($n)" -ret=0 -get_named_xfer_stats ns4/named.run 10.53.0.4 test "IXFR ended" > stats.outgoing -diff ixfr-stats.good stats.outgoing || ret=1 +ret=1 +for i in 0 1 2 3 4 5 6 7 8 9; do + get_named_xfer_stats ns4/named.run 10.53.0.4 test "IXFR ended" > stats.outgoing + if diff ixfr-stats.good stats.outgoing > /dev/null; then + ret=0 + break + fi + sleep 1 +done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) diff --git a/bin/tests/system/xfer/tests.sh b/bin/tests/system/xfer/tests.sh index dcd4d06ce55..b54f94ebde8 100755 --- a/bin/tests/system/xfer/tests.sh +++ b/bin/tests/system/xfer/tests.sh @@ -502,9 +502,15 @@ status=`expr $status + $tmp` n=`expr $n + 1` echo_i "checking whether named calculates outgoing AXFR statistics correctly" -tmp=0 -get_named_xfer_stats ns3/named.run 10.53.0.2 xfer-stats "AXFR ended" > stats.outgoing -diff axfr-stats.good stats.outgoing || tmp=1 +tmp=1 +for i in 0 1 2 3 4 5 6 7 8 9; do + get_named_xfer_stats ns3/named.run 10.53.0.2 xfer-stats "AXFR ended" > stats.outgoing + if diff axfr-stats.good stats.outgoing > /dev/null; then + tmp=0 + break + fi + sleep 1 +done if test $tmp != 0 ; then echo_i "failed"; fi status=`expr $status + $tmp`