]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix resolver test when built without --enable-querytrace
authorEvan Hunt <each@isc.org>
Fri, 1 Apr 2022 16:51:37 +0000 (09:51 -0700)
committerEvan Hunt <each@isc.org>
Fri, 1 Apr 2022 16:54:44 +0000 (09:54 -0700)
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.

bin/tests/system/feature-test.c
bin/tests/system/resolver/tests.sh

index b7f5fbf81df3f6cc569a950e81598f73a5d4def7..30e6e14575ed9ced929ef92672425ae640825a4c 100644 (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;
index db3c8777e16a5623047e61fbd03ee52c4a1efab1..0d649784383eb005750ba4049056699494939450 100755 (executable)
@@ -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)"