fix resolver test when built without --enable-querytrace

a test case in the 'resolver' system test was reliant on
logged output that would only be present when query tracing
was enabled, as in developer builds. that test case is now
disabled when query tracing is not available. Thanks to
Anton Castelli.
This commit is contained in:
Evan Hunt
2022-04-01 09:51:37 -07:00
parent 7dd8ab7336
commit 5319d8adea
2 changed files with 30 additions and 19 deletions

View File

@@ -37,6 +37,7 @@ usage(void) {
fprintf(stderr, "\t--edns-version\n");
fprintf(stderr, "\t--enable-dnsrps\n");
fprintf(stderr, "\t--enable-dnstap\n");
fprintf(stderr, "\t--enable-querytrace\n");
fprintf(stderr, "\t--gethostname\n");
fprintf(stderr, "\t--gssapi\n");
fprintf(stderr, "\t--have-geoip2\n");
@@ -81,6 +82,14 @@ main(int argc, char **argv) {
#endif /* ifdef HAVE_DNSTAP */
}
if (strcmp(argv[1], "--enable-querytrace") == 0) {
#ifdef WANT_QUERYTRACE
return (0);
#else /* ifdef WANT_QUERYTRACE */
return (1);
#endif /* ifdef WANT_QUERYTRACE */
}
if (strcmp(argv[1], "--gethostname") == 0) {
char hostname[MAXHOSTNAMELEN];
int n;

View File

@@ -832,25 +832,27 @@ grep "1\.2\.3\.4" dig.ns5.out.${n} > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n+1))
echo_i "check that SERVFAIL is returned for an empty question section via TCP ($n)"
ret=0
nextpart ns5/named.run > /dev/null
# bind to local address so that addresses in log messages are consistent
# between platforms
dig_with_opts @10.53.0.5 -b 10.53.0.5 tcpalso.no-questions. a +tries=2 +timeout=15 > dig.ns5.out.${n} || ret=1
grep "status: SERVFAIL" dig.ns5.out.${n} > /dev/null || ret=1
check_namedrun() {
nextpartpeek ns5/named.run > nextpart.out.${n}
grep 'resolving tcpalso.no-questions/A for [^:]*: empty question section, accepting it anyway as TC=1' nextpart.out.${n} > /dev/null || return 1
grep '(tcpalso.no-questions/A): connecting via TCP' nextpart.out.${n} > /dev/null || return 1
grep 'resolving tcpalso.no-questions/A for [^:]*: empty question section$' nextpart.out.${n} > /dev/null || return 1
grep '(tcpalso.no-questions/A): nextitem' nextpart.out.${n} > /dev/null || return 1
return 0
}
retry_quiet 12 check_namedrun || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
if ${FEATURETEST} --enable-querytrace; then
n=$((n+1))
echo_i "check that SERVFAIL is returned for an empty question section via TCP ($n)"
ret=0
nextpart ns5/named.run > /dev/null
# bind to local address so that addresses in log messages are consistent
# between platforms
dig_with_opts @10.53.0.5 -b 10.53.0.5 tcpalso.no-questions. a +tries=2 +timeout=15 > dig.ns5.out.${n} || ret=1
grep "status: SERVFAIL" dig.ns5.out.${n} > /dev/null || ret=1
check_namedrun() {
nextpartpeek ns5/named.run > nextpart.out.${n}
grep 'resolving tcpalso.no-questions/A for [^:]*: empty question section, accepting it anyway as TC=1' nextpart.out.${n} > /dev/null || return 1
grep '(tcpalso.no-questions/A): connecting via TCP' nextpart.out.${n} > /dev/null || return 1
grep 'resolving tcpalso.no-questions/A for [^:]*: empty question section$' nextpart.out.${n} > /dev/null || return 1
grep '(tcpalso.no-questions/A): nextitem' nextpart.out.${n} > /dev/null || return 1
return 0
}
retry_quiet 12 check_namedrun || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
fi
n=$((n+1))
echo_i "checking SERVFAIL is returned when all authoritative servers return FORMERR ($n)"