Corrected several system test issues

- 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 5307bf64ce 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.
This commit is contained in:
Evan Hunt 2021-09-24 15:45:57 -07:00
parent dc1203b426
commit ffbe6268f5
15 changed files with 59 additions and 44 deletions

View file

@ -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

View 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;
};

View 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;
};

View 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;
};

View 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

View 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 "." {

View 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 "." {

View 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;
};

View 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;
};

View 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;

View 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;

View file

@ -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

View 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

View file

@ -19,6 +19,7 @@ options {
listen-on-v6 { none; };
recursion yes;
dnssec-validation yes;
servfail-ttl 0;
};
zone "." {

View file

@ -399,6 +399,7 @@
./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