diff --git a/bin/tests/system/forward/clean.sh b/bin/tests/system/forward/clean.sh index 6d76bb013c..8473402a13 100644 --- a/bin/tests/system/forward/clean.sh +++ b/bin/tests/system/forward/clean.sh @@ -14,6 +14,7 @@ # # Clean up after forward tests. # +rm -f ./statschannel.out.* rm -f ./dig.out.* rm -f ./*/named.conf rm -f ./*/named.memstats diff --git a/bin/tests/system/forward/ns4/named.conf.in b/bin/tests/system/forward/ns4/named.conf.in index c97823dee0..800b9831a7 100644 --- a/bin/tests/system/forward/ns4/named.conf.in +++ b/bin/tests/system/forward/ns4/named.conf.in @@ -24,6 +24,8 @@ options { minimal-responses yes; }; +statistics-channels { inet 10.53.0.4 port @EXTRAPORT1@ allow { localhost; }; }; + zone "." { type hint; file "root.db"; diff --git a/bin/tests/system/forward/tests.sh b/bin/tests/system/forward/tests.sh index b9426997cc..4304dab277 100644 --- a/bin/tests/system/forward/tests.sh +++ b/bin/tests/system/forward/tests.sh @@ -107,6 +107,15 @@ grep "SERVFAIL" dig.out.$n.f2 >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) +# GL#1793 +n=$((n + 1)) +echo_i "checking that the 'serverquota' counter isn't increased because of the SERVFAIL in the previous check ($n)" +ret=0 +"${CURL}" "http://10.53.0.4:${EXTRAPORT1}/json/v1" 2>/dev/null >statschannel.out.$n +grep -F "ServerQuota" statschannel.out.$n >/dev/null && ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + n=$((n + 1)) echo_i "checking for negative caching of forwarder response ($n)" # prime the cache, shutdown the forwarder then check that we can diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index d74b1be6d5..982ff9761b 100755 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -54,7 +54,7 @@ if [ -x "${RESOLVE}" ]; then echo_i "checking that local bound address can be set (Can't query from a denied address) ($n)" ret=0 resolve_with_opts -b 10.53.0.8 -t a -s 10.53.0.1 www.example.org 2>resolve.out.ns1.test${n} || ret=1 - grep "resolution failed: SERVFAIL" resolve.out.ns1.test${n} >/dev/null || ret=1 + grep "resolution failed: failure" resolve.out.ns1.test${n} >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) @@ -98,7 +98,7 @@ if [ -x "${RESOLVE}" ]; then echo_i "checking handling of bogus referrals using dns_client ($n)" ret=0 resolve_with_opts -t a -s 10.53.0.1 www.example.com 2>resolve.out.ns1.test${n} || ret=1 - grep "resolution failed: SERVFAIL" resolve.out.ns1.test${n} >/dev/null || ret=1 + grep "resolution failed: failure" resolve.out.ns1.test${n} >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) fi diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index f8f53d2650..98137a514d 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -3575,7 +3575,7 @@ fctx_getaddresses(fetchctx_t *fctx, bool badcache) { bool all_bad; dns_rdata_ns_t ns; bool need_alternate = false; - bool all_spilled = true; + bool all_spilled = false; unsigned int no_addresses = 0; unsigned int ns_processed = 0; @@ -3735,6 +3735,7 @@ normal_nses: } isc_stdtime_get(&now); + all_spilled = true; /* resets to false below after the first success */ INSIST(ISC_LIST_EMPTY(fctx->finds)); INSIST(ISC_LIST_EMPTY(fctx->altfinds));