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.
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))
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`