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.
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
@@ -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`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user