]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Corrected several system test issues
authorEvan Hunt <each@isc.org>
Fri, 24 Sep 2021 22:45:57 +0000 (15:45 -0700)
committerEvan Hunt <each@isc.org>
Sat, 2 Oct 2021 18:43:59 +0000 (11:43 -0700)
- serve-stale: dig wasn't always running in background when it should.
  some of the serve-stale test cases are based on groups of dig calls
  running simultaneously in the background: the test pauses and resumes
  running after 'wait'. in some cases the final call to dig in a group
  wasn't in the background, and this sometimes caused delays that
  affected later test results.  in another case, a test was simplified
  and made more reliable by running dig in the foreground removing a
  sleep.

- serve-stale: The extension of the dig timeout period from 10 to 11
  seconds in commit 5307bf64ce80 was left undone in a few places and has
  now been completed.

- serve-stale: Resolver-query-timeout was set incorrectly.  a comment
  above a test case in serve-stale/tests.sh says: "We configured a long
  value of 30 seconds for resolver-query-timeout," but
  resolver-query-timeout was actually set to 10, not 30. this is now
  fixed.

- rpz: Force retransfer of the fast-expire zone, to ensure it's fully
  loaded in ns3; previously it could have been left unloaded if ns5
  wasn't up yet when ns3 attempted the zone transfer.

- statistics: The TCP4SendErr counter is incremented when a TCP dispatch
  is canceled while sending. depending on test timing, this may have
  happened by the time the statistics are dumped. worked around by
  ignoring that stat couunter when checking for errors.

- hooks: Add a prereq.sh script to prevent running under TSAN.

- zero: Disabled the servfail cache so that SERVFAIL is reported only
  when there actually is a failure, not repeatedly every time the same
  query is sent.

15 files changed:
bin/tests/system/hooks/prereq.sh [new file with mode: 0644]
bin/tests/system/qmin/ns5/named.conf.in
bin/tests/system/qmin/ns6/named.conf.in
bin/tests/system/qmin/ns7/named.conf.in
bin/tests/system/rpz/tests.sh
bin/tests/system/serve-stale/ns3/named2.conf.in
bin/tests/system/serve-stale/ns3/named3.conf.in
bin/tests/system/serve-stale/ns3/named4.conf.in
bin/tests/system/serve-stale/ns3/named5.conf.in
bin/tests/system/serve-stale/ns3/named6.conf.in
bin/tests/system/serve-stale/ns3/named7.conf.in
bin/tests/system/serve-stale/tests.sh
bin/tests/system/statistics/tests.sh
bin/tests/system/zero/ns3/named.conf.in
util/copyrights

diff --git a/bin/tests/system/hooks/prereq.sh b/bin/tests/system/hooks/prereq.sh
new file mode 100644 (file)
index 0000000..140acc3
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+. ../conf.sh
+
+$FEATURETEST --tsan && {
+       echo_i "TSAN - skipping hooks test"
+        exit 255
+}
+
+exit 0
index b4163ab0660998e3c67f66307263f0fee4467e12..2171a6265aa6f98e92cc331b7dc7479253c57c6d 100644 (file)
@@ -22,7 +22,7 @@ options {
        recursion yes;
        qname-minimization disabled;
        querylog yes;
-       resolver-query-timeout 30;
+       resolver-query-timeout 30000; # 30 seconds
        dnssec-validation no;
 };
 
index c5fe9adc6043623671615fd6921a6fd834f12078..ec34d03146f5967f275f236961edc38852a45528 100644 (file)
@@ -22,7 +22,7 @@ options {
        recursion yes;
        qname-minimization strict;
        querylog yes;
-       resolver-query-timeout 30;
+       resolver-query-timeout 30000; # 30 seconds
        dnssec-validation no;
 };
 
index 0f69d2d26ba9dfd6049ee665001ff6cf56122b51..50fce36c506c85de5d083d8c4d4270fa88d21a6a 100644 (file)
@@ -22,7 +22,7 @@ options {
        recursion yes;
        qname-minimization relaxed;
        querylog yes;
-       resolver-query-timeout 30;
+       resolver-query-timeout 30000; # 30 seconds
        dnssec-validation no;
 };
 
index c888289db41cb48392a0cbdc3ce3080aaa38cd98..b88fe62a48dbc122dc19c469761bf6144d550a90 100644 (file)
@@ -453,6 +453,9 @@ make_proto_nodata() {
   return 0
 }
 
+# ensure that the fast-expire zone is populated before we begin testing
+$RNDCCMD $ns3 retransfer fast-expire
+
 for mode in native dnsrps; do
   status=0
   case ${mode} in
index 40c053e07feb102ecc57503fd3154ca087717f64..57919b7bbe2cd86185bd9399f47ceac01e1bdae8 100644 (file)
@@ -37,9 +37,9 @@ options {
        stale-cache-enable yes;
        stale-answer-ttl 3;
        stale-refresh-time 0;
-       stale-answer-client-timeout 1800;
+       stale-answer-client-timeout 1800; # 1.8 seconds
        max-stale-ttl 3600;
-       resolver-query-timeout 10;
+       resolver-query-timeout 30000; # 30 seconds
 };
 
 zone "." {
index 7d50bc8ff8f588e9f462142e8711f787214a21d3..5a840e9cdf442044d7dc079ca830cd2d56d13f43 100644 (file)
@@ -38,7 +38,7 @@ options {
        stale-answer-ttl 3;
        stale-refresh-time 0;
        max-stale-ttl 3600;
-       resolver-query-timeout 10;
+       resolver-query-timeout 10000; # 10 seconds
 };
 
 zone "." {
index 5fd5ef82f4363506e53a43649a4d5ab7c9073236..af3bd868a2c919475fa1c78d98fa464825980c08 100644 (file)
@@ -38,7 +38,7 @@ options {
        stale-answer-ttl 3;
        stale-answer-client-timeout 0;
        stale-refresh-time 0;
-       resolver-query-timeout 10;
+       resolver-query-timeout 10000; # 10 seconds
        max-stale-ttl 3600;
 };
 
index 92b2cdf1086ffae46ed7e8216775c9bbbe4baa88..e62de8bfb1371f885f62d3951f699f640bfd2281 100644 (file)
@@ -38,7 +38,7 @@ options {
        stale-answer-ttl 3;
        stale-answer-client-timeout 0;
        stale-refresh-time 4;
-       resolver-query-timeout 10;
+       resolver-query-timeout 10000; # 10 seconds
        max-stale-ttl 3600;
 };
 
index 2b7c42c456f518df9c37a0306ec126c444b7dc15..92c0eaf0571904977a4ccfd9c1f901f7a22b6d79 100644 (file)
@@ -37,7 +37,7 @@ options {
        stale-cache-enable yes;
        stale-answer-ttl 3;
        stale-refresh-time 4;
-       resolver-query-timeout 10;
+       resolver-query-timeout 10000; # 10 seconds
        fetches-per-zone 1 fail;
        fetches-per-server 1 fail;
        max-stale-ttl 3600;
index 10e77d7d2571595b3f431eb2e4494c3de5ce137f..c3582ba084cedb0759850b9b2d19b125f61e1040 100644 (file)
@@ -41,7 +41,7 @@ options {
        stale-cache-enable yes;
        stale-answer-ttl 3;
        stale-refresh-time 4;
-       resolver-query-timeout 10;
+       resolver-query-timeout 10000; # 10 seconds
        fetches-per-zone 1 fail;
        fetches-per-server 1 fail;
        max-stale-ttl 3600;
index c49f6647bf457badec017b06521e254ff3bf66a5..b524630d9e298a2ca91d1a6cccdffaa48b7a2a49 100755 (executable)
@@ -124,7 +124,7 @@ $DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.1 longttl.example TXT > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.1 othertype.example CAA > dig.out.test$((n+3)) &
 $DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$((n+4)) &
-$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+5))
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+5)) &
 
 wait
 
@@ -282,7 +282,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.1 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
@@ -336,7 +336,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.1 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
@@ -402,7 +402,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.1 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
@@ -594,7 +594,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.1 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
@@ -672,7 +672,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.1 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
@@ -1006,7 +1006,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.3 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
@@ -1094,7 +1094,7 @@ $DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.3 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$((n+3)) &
 $DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$((n+4)) &
-$DIG -p ${PORT} @10.53.0.3 notfound.example TXT > dig.out.test$((n+5))
+$DIG -p ${PORT} @10.53.0.3 notfound.example TXT > dig.out.test$((n+5)) &
 
 wait
 
@@ -1247,7 +1247,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.4 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.4 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.4 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.4 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.4 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
@@ -1453,7 +1453,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.5 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.5 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.5 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.5 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.5 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
@@ -1651,8 +1651,8 @@ nextpart ns3/named.run > /dev/null
 
 echo_i "sending queries for tests $((n+1))-$((n+2))..."
 t1=`$PERL -e 'print time()'`
-$DIG -p ${PORT} +tries=1 +timeout=10  @10.53.0.3 data.example TXT > dig.out.test$((n+1)) &
-$DIG -p ${PORT} +tries=1 +timeout=10  @10.53.0.3 nodata.example TXT > dig.out.test$((n+2))
+$DIG -p ${PORT} +tries=1 +timeout=11  @10.53.0.3 data.example TXT > dig.out.test$((n+1)) &
+$DIG -p ${PORT} +tries=1 +timeout=11  @10.53.0.3 nodata.example TXT > dig.out.test$((n+2)) &
 wait
 t2=`$PERL -e 'print time()'`
 
@@ -1687,14 +1687,14 @@ status=$((status+ret))
 nextpart ns3/named.run > /dev/null
 
 echo_i "sending queries for tests $((n+2))-$((n+3))..."
-$DIG -p ${PORT} +tries=1 +timeout=3   @10.53.0.3 longttl.example TXT > dig.out.test$((n+2)) &
+# first dig runs in background for 3 seconds, second in foreground for 3
 $DIG -p ${PORT} +tries=1 +timeout=10  @10.53.0.3 longttl.example TXT > dig.out.test$((n+3)) &
+$DIG -p ${PORT} +tries=1 +timeout=3   @10.53.0.3 longttl.example TXT > dig.out.test$((n+2))
 
 # Enable the authoritative name server after stale-answer-client-timeout.
 n=$((n+1))
 echo_i "enable responses from authoritative server ($n)"
 ret=0
-sleep 4
 $DIG -p ${PORT} @10.53.0.2 txt enable  > dig.out.test$n
 grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
 grep "TXT.\"1\"" dig.out.test$n > /dev/null || ret=1
@@ -1705,25 +1705,17 @@ n=$((n+1))
 echo_i "check not in cache longttl.example times out (stale-answer-client-timeout 1.8) ($n)"
 ret=0
 wait_for_log 4 "longttl.example client timeout, stale answer unavailable" ns3/named.run || ret=1
-check_results() {
-    [ -s "$1" ] || return 1
-    grep "connection timed out" "$1" > /dev/null || return 1
-    return 0
-}
-retry_quiet 4 check_results dig.out.test$n || ret=1
+grep "connection timed out" dig.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
+wait
+
 n=$((n+1))
 echo_i "check not in cache longttl.example comes from authoritative (stale-answer-client-timeout 1.8) ($n)"
 ret=0
-check_results() {
-    [ -s "$1" ] || return 1
-    grep "status: NOERROR" "$1" > /dev/null || return 1
-    grep "ANSWER: 1," "$1" > /dev/null || return 1
-    return 0
-}
-retry_quiet 8 check_results dig.out.test$n || ret=1
+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
@@ -2214,7 +2206,7 @@ echo_i "sending queries for tests $((n+1))-$((n+4))..."
 $DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$((n+1)) &
 $DIG -p ${PORT} @10.53.0.3 othertype.example CAA > dig.out.test$((n+2)) &
 $DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$((n+3)) &
-$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$((n+4))
+$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$((n+4)) &
 
 wait
 
index 2c44788ce148c5e12ad4cb2378ae2616b394a542..b019dfac695341850584f2fed71ec42d8080329b 100644 (file)
@@ -11,8 +11,7 @@
 
 . ../conf.sh
 
-DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd"
-DIGCMD="$DIG $DIGOPTS -p ${PORT}"
+DIGCMD="$DIG +tcp -p ${PORT}"
 RNDCCMD="$RNDC -p ${CONTROLPORT} -c ../common/rndc.conf"
 
 status=0
@@ -163,8 +162,8 @@ n=`expr $n + 1`
 ret=0
 echo_i "checking bind9.xsl vs xml ($n)"
 if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ]  ; then
-    $DIGCMD +notcp +recurse @10.53.0.3 soa . > /dev/null 2>&1
-    $DIGCMD +notcp +recurse @10.53.0.3 soa example > /dev/null 2>&1
+    $DIGCMD +notcp +recurse @10.53.0.3 soa . > dig.out.test$n.1 2>&1
+    $DIGCMD +notcp +recurse @10.53.0.3 soa example > dig.out.test$n.2 2>&1
     ${CURL} http://10.53.0.3:${EXTRAPORT1}/xml/v3 > curl.out.${n}.xml 2>/dev/null || ret=1
     ${CURL} http://10.53.0.3:${EXTRAPORT1}/bind9.xsl > curl.out.${n}.xsl 2>/dev/null || ret=1
     ${XSLTPROC} curl.out.${n}.xsl - < curl.out.${n}.xml > xsltproc.out.${n} 2>/dev/null || ret=1
@@ -181,7 +180,7 @@ if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ]  ; th
     grep "<h3>View " xsltproc.out.${n} >/dev/null || ret=1
     grep "<h2>Server Statistics</h2>" xsltproc.out.${n} >/dev/null || ret=1
     grep "<h2>Zone Maintenance Statistics</h2>" xsltproc.out.${n} >/dev/null || ret=1
-    grep "<h2>Resolver Statistics (Common)</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Resolver Statistics (Common)</h2>" xsltproc.out.${n} >/dev/null || ret=1
     grep "<h3>Resolver Statistics for View " xsltproc.out.${n} >/dev/null || ret=1
     grep "<h3>ADB Statistics for View " xsltproc.out.${n} >/dev/null || ret=1
     grep "<h3>Cache Statistics for View " xsltproc.out.${n} >/dev/null || ret=1
@@ -223,7 +222,7 @@ if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ]  ; th
     grep "<counter name=\"TCP4ConnFail\">0</counter>" stats.xml.out >/dev/null || ret=1
     grep "<counter name=\"TCP4OpenFail\">0</counter>" stats.xml.out >/dev/null || ret=1
     grep "<counter name=\"TCP4RecvErr\">0</counter>" stats.xml.out >/dev/null || ret=1
-    grep "<counter name=\"TCP4SendErr\">0</counter>" stats.xml.out >/dev/null || ret=1
+    grep "<counter name=\"TCP4SendErr\">0</counter>" stats.xml.out >/dev/null || ret=1
 
     grep "<counter name=\"TCP6AcceptFail\">0</counter>" stats.xml.out >/dev/null || ret=1
     grep "<counter name=\"TCP6BindFail\">0</counter>" stats.xml.out >/dev/null || ret=1
index aa35d03fc56d2ae20aa877831c701e854798d53b..39044310c6705028f1ae586ec92f3b072b0cfe66 100644 (file)
@@ -19,6 +19,7 @@ options {
        listen-on-v6 { none; };
        recursion yes;
        dnssec-validation yes;
+       servfail-ttl 0;
 };
 
 zone "." {
index dff5713217b2cefda1c33f238ef6b2d3b1ff1c57..42ce88bb7e6f98442f053c8887e92a4fdd50a014 100644 (file)
 ./bin/tests/system/glue/tests.sh               SH      2000,2001,2003,2004,2007,2012,2013,2016,2017,2018,2019,2020,2021
 ./bin/tests/system/hooks/clean.sh              SH      2020,2021
 ./bin/tests/system/hooks/driver/test-async.c   C       2020,2021
+./bin/tests/system/hooks/prereq.sh             SH      2021
 ./bin/tests/system/hooks/setup.sh              SH      2020,2021
 ./bin/tests/system/hooks/tests.sh              SH      2020,2021
 ./bin/tests/system/idna/clean.sh               SH      2018,2019,2020,2021