]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check ANY lookup using nslookup
authorMark Andrews <marka@isc.org>
Sun, 4 Dec 2022 22:18:51 +0000 (09:18 +1100)
committerMark Andrews <marka@isc.org>
Mon, 5 Dec 2022 21:57:48 +0000 (08:57 +1100)
bin/tests/system/nslookup/tests.sh

index e3dd0f526439308ee8a1c33f13042c638981a17e..1978eb40f304303332dae019201561f03f570862 100644 (file)
@@ -122,5 +122,20 @@ grep "2001::ffff" nslookup.out${n} > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
+n=$((n+1))
+echo_i "Check ANY lookup ($n)"
+ret=0
+$NSLOOKUP -port=${PORT} -type=ANY example.net 10.53.0.1 2> nslookup.err${n} > nslookup.out${n} || ret=1
+lines=$(grep -c 'Address:.10\.53\.0\.1#'"${PORT}" nslookup.out${n})
+test $lines -eq 1 || ret=1
+lines=$(grep -c 'origin = ns1\.example\.net' nslookup.out${n})
+test $lines -eq 1 || ret=1
+lines=$(grep -c 'mail addr = hostmaster\.example\.net' nslookup.out${n})
+test $lines -eq 1 || ret=1
+lines=$(grep -c 'nameserver = ns1\.example\.net.' nslookup.out${n})
+test $lines -eq 1 || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status+ret))
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1