From 4a992c7a18ef943d562c157f6724fe2dcaba4f45 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 23 Jan 2020 13:31:47 +1100 Subject: [PATCH 1/2] check that all servers have finished loading before beginging tests --- bin/tests/system/dnstap/clean.sh | 1 + bin/tests/system/dnstap/tests.sh | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/bin/tests/system/dnstap/clean.sh b/bin/tests/system/dnstap/clean.sh index 3faed40d43..20adeeb9e5 100644 --- a/bin/tests/system/dnstap/clean.sh +++ b/bin/tests/system/dnstap/clean.sh @@ -12,6 +12,7 @@ rm -f */named.conf rm -f */named.memstats rm -f */named.run +rm -f */named.run.prev rm -f */named.stats rm -f dig.out* rm -f dnstap.out dnstap.hex diff --git a/bin/tests/system/dnstap/tests.sh b/bin/tests/system/dnstap/tests.sh index 2b701a495f..adb8303580 100644 --- a/bin/tests/system/dnstap/tests.sh +++ b/bin/tests/system/dnstap/tests.sh @@ -35,6 +35,15 @@ do status=`expr $status + $ret` done +echo_i "wait for servers to finish loading" +ret=0 +wait_for_log 20 "all zones loaded" ns1/named.run || ret=1 +wait_for_log 20 "all zones loaded" ns2/named.run || ret=1 +wait_for_log 20 "all zones loaded" ns3/named.run || ret=1 +wait_for_log 20 "all zones loaded" ns4/named.run || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + $DIG $DIGOPTS @10.53.0.3 a.example > dig.out # check three different dnstap reopen/roll methods: @@ -71,6 +80,7 @@ EOF $RNDCCMD -s 10.53.0.1 stop | sed 's/^/ns1 /' | cat_i $RNDCCMD -s 10.53.0.2 stop | sed 's/^/ns2 /' | cat_i $RNDCCMD -s 10.53.0.3 stop | sed 's/^/ns3 /' | cat_i + sleep 1 echo_i "checking initial message counts" From 9b6df37303a9b091f1c6742cfa4a0108ca7848c4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 23 Jan 2020 13:54:56 +1100 Subject: [PATCH 2/2] wait for the ./NS lookup to complete --- bin/tests/system/dnstap/tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/tests/system/dnstap/tests.sh b/bin/tests/system/dnstap/tests.sh index adb8303580..9fe748d3f6 100644 --- a/bin/tests/system/dnstap/tests.sh +++ b/bin/tests/system/dnstap/tests.sh @@ -44,7 +44,12 @@ wait_for_log 20 "all zones loaded" ns4/named.run || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` +# both the 'a.example/A' lookup and the './NS' lookup to ns1 +# need tocomplete before reopening/rolling for the counts to +# be correct. + $DIG $DIGOPTS @10.53.0.3 a.example > dig.out +wait_for_log 20 "(./NS): query_reset" ns1/named.run || true # check three different dnstap reopen/roll methods: # ns1: dnstap-reopen; ns2: dnstap -reopen; ns3: dnstap -roll