]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Make the resolver qtype ANY test order agnostic
authorOndřej Surý <ondrej@isc.org>
Mon, 17 Jun 2024 15:54:09 +0000 (17:54 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 1 Jul 2024 10:47:30 +0000 (12:47 +0200)
Instead of relying on a specific order of the RR types in the databases
pick the first RR type as returned from the cache.

bin/tests/system/resolver/tests.sh

index 7ada50fe183c7618cad67906512caaa72c3b8430..69a0850e8ddb02a3762730870bb87581e47a9821 100755 (executable)
@@ -474,18 +474,18 @@ n=$((n + 1))
 echo_i "check prefetch qtype * (${n})"
 ret=0
 dig_with_opts @10.53.0.5 fetchall.tld any >dig.out.1.${n} || ret=1
-ttl1=$(awk '/"A" "short" "ttl"/ { print $2 - 3 }' dig.out.1.${n})
+ttl1=$(awk '/^fetchall.tld/ { print $2 - 3; exit }' dig.out.1.${n})
 # sleep so we are in prefetch range
 sleep "${ttl1:-0}"
 # trigger prefetch
 dig_with_opts @10.53.0.5 fetchall.tld any >dig.out.2.${n} || ret=1
-ttl2=$(awk '/"A" "short" "ttl"/ { print $2 }' dig.out.2.${n})
+ttl2=$(awk '/^fetchall.tld/ { print $2; exit }' dig.out.2.${n})
 sleep 1
 # check that prefetch occurred;
-# note that only one record is prefetched, which is the AAAA record in this case,
+# note that only the first record is prefetched,
 # because of the order of the records in the cache
 dig_with_opts @10.53.0.5 fetchall.tld any >dig.out.3.${n} || ret=1
-ttl3=$(awk '/::1/ { print $2 }' dig.out.3.${n})
+ttl3=$(awk '/^fetchall.tld/ { print $2; exit }' dig.out.3.${n})
 test "${ttl3:-0}" -gt "${ttl2:-1}" || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))