]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Wait for outgoing transfer statistics to be logged
authorMichał Kępień <michal@isc.org>
Tue, 25 Jun 2019 12:30:16 +0000 (14:30 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 25 Jun 2019 19:41:42 +0000 (21:41 +0200)
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.

bin/tests/system/ixfr/tests.sh
bin/tests/system/xfer/tests.sh

index 3f8a2ef45788ebcf6e83edb3618ebe4596485a65..e14fbc028c341378de2dc64c341e2ebf75a8ba3c 100644 (file)
@@ -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))
 
index dcd4d06ce55a903369cd2dcf2bf8e781e71bbd66..b54f94ebde8fbd5e66aa984bbc89bafc048fd1ca 100755 (executable)
@@ -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`