From 375918493e1d9556c33d1541daba15c89bcd2227 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 5 Dec 2022 09:18:51 +1100 Subject: [PATCH] Check ANY lookup using nslookup (cherry picked from commit c367dd1b0b40709b03499e21b33ea381655ec6fc) --- bin/tests/system/nslookup/tests.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/tests/system/nslookup/tests.sh b/bin/tests/system/nslookup/tests.sh index e3dd0f5264..1978eb40f3 100644 --- a/bin/tests/system/nslookup/tests.sh +++ b/bin/tests/system/nslookup/tests.sh @@ -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