diff --git a/bin/tests/system/hooks/prereq.sh b/bin/tests/system/hooks/prereq.sh new file mode 100644 index 0000000000..140acc3d36 --- /dev/null +++ b/bin/tests/system/hooks/prereq.sh @@ -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 diff --git a/bin/tests/system/qmin/ns5/named.conf.in b/bin/tests/system/qmin/ns5/named.conf.in index b4163ab066..2171a6265a 100644 --- a/bin/tests/system/qmin/ns5/named.conf.in +++ b/bin/tests/system/qmin/ns5/named.conf.in @@ -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; }; diff --git a/bin/tests/system/qmin/ns6/named.conf.in b/bin/tests/system/qmin/ns6/named.conf.in index c5fe9adc60..ec34d03146 100644 --- a/bin/tests/system/qmin/ns6/named.conf.in +++ b/bin/tests/system/qmin/ns6/named.conf.in @@ -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; }; diff --git a/bin/tests/system/qmin/ns7/named.conf.in b/bin/tests/system/qmin/ns7/named.conf.in index 0f69d2d26b..50fce36c50 100644 --- a/bin/tests/system/qmin/ns7/named.conf.in +++ b/bin/tests/system/qmin/ns7/named.conf.in @@ -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; }; diff --git a/bin/tests/system/rpz/tests.sh b/bin/tests/system/rpz/tests.sh index c888289db4..b88fe62a48 100644 --- a/bin/tests/system/rpz/tests.sh +++ b/bin/tests/system/rpz/tests.sh @@ -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 diff --git a/bin/tests/system/serve-stale/ns3/named2.conf.in b/bin/tests/system/serve-stale/ns3/named2.conf.in index 40c053e07f..57919b7bbe 100644 --- a/bin/tests/system/serve-stale/ns3/named2.conf.in +++ b/bin/tests/system/serve-stale/ns3/named2.conf.in @@ -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 "." { diff --git a/bin/tests/system/serve-stale/ns3/named3.conf.in b/bin/tests/system/serve-stale/ns3/named3.conf.in index 7d50bc8ff8..5a840e9cdf 100644 --- a/bin/tests/system/serve-stale/ns3/named3.conf.in +++ b/bin/tests/system/serve-stale/ns3/named3.conf.in @@ -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 "." { diff --git a/bin/tests/system/serve-stale/ns3/named4.conf.in b/bin/tests/system/serve-stale/ns3/named4.conf.in index 5fd5ef82f4..af3bd868a2 100644 --- a/bin/tests/system/serve-stale/ns3/named4.conf.in +++ b/bin/tests/system/serve-stale/ns3/named4.conf.in @@ -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; }; diff --git a/bin/tests/system/serve-stale/ns3/named5.conf.in b/bin/tests/system/serve-stale/ns3/named5.conf.in index 92b2cdf108..e62de8bfb1 100644 --- a/bin/tests/system/serve-stale/ns3/named5.conf.in +++ b/bin/tests/system/serve-stale/ns3/named5.conf.in @@ -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; }; diff --git a/bin/tests/system/serve-stale/ns3/named6.conf.in b/bin/tests/system/serve-stale/ns3/named6.conf.in index 2b7c42c456..92c0eaf057 100644 --- a/bin/tests/system/serve-stale/ns3/named6.conf.in +++ b/bin/tests/system/serve-stale/ns3/named6.conf.in @@ -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; diff --git a/bin/tests/system/serve-stale/ns3/named7.conf.in b/bin/tests/system/serve-stale/ns3/named7.conf.in index 10e77d7d25..c3582ba084 100644 --- a/bin/tests/system/serve-stale/ns3/named7.conf.in +++ b/bin/tests/system/serve-stale/ns3/named7.conf.in @@ -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; diff --git a/bin/tests/system/serve-stale/tests.sh b/bin/tests/system/serve-stale/tests.sh index c49f6647bf..b524630d9e 100755 --- a/bin/tests/system/serve-stale/tests.sh +++ b/bin/tests/system/serve-stale/tests.sh @@ -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 diff --git a/bin/tests/system/statistics/tests.sh b/bin/tests/system/statistics/tests.sh index 2c44788ce1..b019dfac69 100644 --- a/bin/tests/system/statistics/tests.sh +++ b/bin/tests/system/statistics/tests.sh @@ -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 "