From: Martin Basti Date: Tue, 21 Jul 2026 13:49:00 +0000 (+0000) Subject: Test that +short does not leak the ";; " comments X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=6dc2d6b2eb3e0deada16154c3f8281acbf9bad80;p=thirdparty%2Fbind9.git Test that +short does not leak the ";; " comments Plain +short already turns lookup->comments off, so the regression it guards against only surfaces with "+short +comments", where +comments re-enables the comment toggle while short form is still in effect. The existing silent-then-servfail scenario is reused because its retry path reliably prints a "Got SERVFAIL reply from ..." comment; the +comments case (without +short) is asserted first so the absence check is meaningful. Assisted-by: Claude:claude-opus-4-8 --- diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index bbdbe531d46..17587f7ab90 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -1342,6 +1342,28 @@ if [ -x "$DIG" ]; then if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status + ret)) + # With +short, dig must not emit the ";; " progress/error comments (here: + # the "Got SERVFAIL reply from ..." note printed while retrying). +short + # normally turns comments off, but "+short +comments" re-enables them while + # short form is still in effect; the comment output then belongs to the + # verbose form and would corrupt the short output. The "+comments" case + # (without +short) is checked first so the absence check below is meaningful. + n=$((n + 1)) + echo_i "check that dig +comments emits the retry comment ($n)" + ret=0 + dig_with_opts +timeout=1 +nofail +comments @10.53.0.7 silent-then-servfail.example >dig.out.test$n 2>&1 || ret=1 + grep -F ";; Got SERVFAIL reply from" dig.out.test$n >/dev/null || ret=1 + if [ $ret -ne 0 ]; then echo_i "failed"; fi + status=$((status + ret)) + + n=$((n + 1)) + echo_i "check that dig +short +comments suppresses the retry comment ($n)" + ret=0 + dig_with_opts +timeout=1 +nofail +short +comments @10.53.0.7 silent-then-servfail.example >dig.out.test$n 2>&1 || ret=1 + grep -F ";; Got SERVFAIL reply from" dig.out.test$n >/dev/null && ret=1 + if [ $ret -ne 0 ]; then echo_i "failed"; fi + status=$((status + ret)) + n=$((n + 1)) echo_i "check that dig tries the next server after a UDP socket network unreachable error ($n)" ret=0