From 21431206366e5c4f019f82e4e9b8e6963d3919a9 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Sun, 17 Oct 2021 11:45:21 -0700 Subject: [PATCH 1/4] Fix digdelv test error The digdelv system test has a test case in which stderr was included in the dig output. When trace logging was in use, this confused the grep and caused a spurious test failure. --- bin/tests/system/digdelv/tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index 0a86ea7d16..139efb878e 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -1294,7 +1294,7 @@ if [ -x "$DELV" ] ; then n=$((n+1)) echo_i "check delv +yaml output ($n)" ret=0 - delv_with_opts +yaml @10.53.0.3 any ns2.example > delv.out.test$n 2>&1 || ret=1 + delv_with_opts +yaml @10.53.0.3 any ns2.example > delv.out.test$n || ret=1 $PYTHON yamlget.py delv.out.test$n status > yamlget.out.test$n 2>&1 || ret=1 read -r value < yamlget.out.test$n [ "$value" = "success" ] || ret=1 From 9b6060c6c476998c9e5f8faf6169ab148dd9a103 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Sun, 17 Oct 2021 11:45:21 -0700 Subject: [PATCH 2/4] Fix catz test error The catz system test included a test case that was looking for a single answer record after an update, when it should have been looking for two. The test usually passed because of timing - the first dig usually got a response before the update was completed - but occasionally the update processed fast enough for the test to fail. On investigation, it turned out to be the test that was wrong. --- bin/tests/system/catz/tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tests/system/catz/tests.sh b/bin/tests/system/catz/tests.sh index 5197fbd94c..f51ac4ba27 100644 --- a/bin/tests/system/catz/tests.sh +++ b/bin/tests/system/catz/tests.sh @@ -216,7 +216,7 @@ echo_i "wait for secondary to be updated again ($n)" ret=0 wait_for_txt() { dig_with_opts @10.53.0.2 TXT foo.dom1.example. > dig.out.test$n || return 1 - grep "ANSWER: 1," dig.out.test$n > /dev/null || return 1 + grep "ANSWER: 2," dig.out.test$n > /dev/null || return 1 grep "status: NOERROR" dig.out.test$n > /dev/null || return 1 grep "IN.TXT." dig.out.test$n > /dev/null || return 1 } From 3ecaccb961bb1dd3a338a1c6ef26e009e4ea5451 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Sun, 17 Oct 2021 11:45:21 -0700 Subject: [PATCH 3/4] Fix cds test error The margin of error (up to 2 seconds) allowed for the inception time in the cds system test was a bit too small, and has been increased to 3 seconds. --- bin/tests/system/cds/checktime.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tests/system/cds/checktime.pl b/bin/tests/system/cds/checktime.pl index 692b840adc..aa742106ba 100644 --- a/bin/tests/system/cds/checktime.pl +++ b/bin/tests/system/cds/checktime.pl @@ -22,4 +22,4 @@ while (<>) { die "missing notbefore time" unless $notbefore; die "missing inception time" unless $inception; my $delta = $inception - $notbefore; -die "bad inception time $delta" unless abs($delta - $target) < 3; +die "bad inception time $delta" unless abs($delta - $target) <= 3; From c167feb1dc9d35bc8770c4311a0987f702a1da47 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Sun, 17 Oct 2021 11:45:21 -0700 Subject: [PATCH 4/4] Fix statistics test error The statistics system test sometimes needs a pause to wait for the expected stats to be reported. Also, the test for priming queries was ineffective; the result of the grep was not being checked. --- bin/tests/system/statistics/tests.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bin/tests/system/statistics/tests.sh b/bin/tests/system/statistics/tests.sh index 8db7741013..02283fd69a 100644 --- a/bin/tests/system/statistics/tests.sh +++ b/bin/tests/system/statistics/tests.sh @@ -89,7 +89,11 @@ $DIGCMD +tries=2 +time=1 +recurse @10.53.0.3 foo.info. any > /dev/null 2>&1 ret=0 echo_i "dumping updated stats for ns3 ($n)" -rndc_stats ns3 10.53.0.3 || ret=1 +getstats() { + rndc_stats ns3 10.53.0.3 || return 1 + grep "2 recursing clients" $last_stats > /dev/null || return 1 +} +retry_quiet 5 getstats || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1` @@ -135,6 +139,13 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1` +ret=0 +echo_i "checking priming queries are counted ($n)" +grep "1 priming queries" $last_stats > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` +n=`expr $n + 1` + ret=0 echo_i "checking that zones with slash are properly shown in XML output ($n)" if $FEATURETEST --have-libxml2 && [ -x ${CURL} ] ; then @@ -236,13 +247,6 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1` -ret=0 -echo_i "checking priming queries are counted ($n)" -grep "1 priming queries" $last_stats -if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` -n=`expr $n + 1` - echo_i "Check that 'zone-statistics full;' is processed by 'rndc reconfig' ($n)" ret=0 # off by default