From 8d3df06100e212bb2da5d26aa84aaf47b8bd7276 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 11 Feb 2026 13:56:59 -0800 Subject: [PATCH] Fix tests for parent-centric resolver behavior In 'additional', pre-cache the A RRset for ns1.rt.example so the additional-data handling in the cache can be tested; previously this was cached as part of resolution, but now must be queried explicitly. In 'cookie', pre-cache an NS to prevent a QMIN query from distorting log results and causing a test failure. In 'resolver', increase the expected query count in the timeout test. --- bin/tests/system/additional/tests.sh | 2 ++ bin/tests/system/cookie/tests.sh | 2 +- bin/tests/system/resolver/tests.sh | 14 +++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bin/tests/system/additional/tests.sh b/bin/tests/system/additional/tests.sh index 27dca50e79..e434474ab1 100644 --- a/bin/tests/system/additional/tests.sh +++ b/bin/tests/system/additional/tests.sh @@ -373,6 +373,8 @@ fi n=$((n + 1)) echo_i "testing NS handling in ANY responses (recursive) ($n)" ret=0 +# pre-cache the address record +$DIG $DIGOPTS -t A ns1.rt.example @10.53.0.3 >/dev/null || ret=1 $DIG $DIGOPTS -t ANY rt.example @10.53.0.3 >dig.out.$n || ret=1 grep "AUTHORITY: 0" dig.out.$n >/dev/null || ret=1 grep "NS[ ]*ns" dig.out.$n >/dev/null || ret=1 diff --git a/bin/tests/system/cookie/tests.sh b/bin/tests/system/cookie/tests.sh index 5c08beb05c..36ba494030 100755 --- a/bin/tests/system/cookie/tests.sh +++ b/bin/tests/system/cookie/tests.sh @@ -566,7 +566,7 @@ sys.exit(1)'; then ret=0 pat='10\.53\.0\.10 .*\[cookie=................................\] \[ttl' # prime EDNS COOKIE state - $DIG $DIGOPTS @10.53.0.1 tsig. >dig.out.test$n.1 || ret=1 + $DIG $DIGOPTS @10.53.0.1 NS tsig. >dig.out.test$n.1 || ret=1 grep "status: NOERROR" dig.out.test$n.1 >/dev/null || ret=1 rndc_dumpdb ns1 # prime cache with NS response for QNAME minimisation diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index bd8f8972c2..e9affc1cb4 100755 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -76,13 +76,21 @@ n=$((n + 1)) echo_i "checking that the timeout didn't skew the resolver responses counters and did update the timeout counter ($n)" ret=0 rndccmd 10.53.0.1 stats || ret=1 +# the timeout query triggers two extra queries, so we expect a small increase grep -F 'responses received' ns1/named.stats >ns1/named.stats.responses-after || true +read before _ ns1/named.stats.rtt-after || true +read before _ ns1/named.stats.timeouts-after || true mv ns1/named.stats ns1/named.stats-after -diff ns1/named.stats.responses-before ns1/named.stats.responses-after >/dev/null || ret=1 -diff ns1/named.stats.rtt-before ns1/named.stats.rtt-after >/dev/null || ret=1 -diff ns1/named.stats.timeouts-before ns1/named.stats.timeouts-after >/dev/null && ret=1 +read before _