Add system tests for IXFR statistics

Ensure IXFR statistics are calculated correctly by dig and named, both
for incoming and outgoing transfers.  Disable EDNS when using dig to
request an IXFR so that the same reference file can be used for testing
statistics calculated by both dig and named (dig uses EDNS by default
when sending transfer requests, which affects the number of bytes
transferred).
This commit is contained in:
Michał Kępień
2019-01-31 15:43:58 +01:00
committed by Evan Hunt
parent a22e24a411
commit a9a47c79e9
4 changed files with 31 additions and 1 deletions

View File

@@ -307,5 +307,30 @@ if [ ${ret} != 0 ]; then
status=1;
fi
echo_i "checking whether dig calculates IXFR statistics correctly"
ret=0
$DIG $DIGOPTS +noedns +stat -b 10.53.0.4 @10.53.0.4 test. ixfr=2 > dig.out1
get_dig_xfer_stats dig.out1 > stats.dig
diff ixfr-stats.good stats.dig || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
# Note: in the next two tests, we use ns4 logs for checking both incoming and
# outgoing transfer statistics as ns4 is both a secondary server (for ns3) and a
# primary server (for dig queries from the previous test) for "test".
echo_i "checking whether named calculates incoming IXFR statistics correctly"
ret=0
get_named_xfer_stats ns4/named.run 10.53.0.3 test "Transfer completed" > stats.incoming
diff ixfr-stats.good stats.incoming || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking whether named calculates outgoing IXFR statistics correctly"
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
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1