]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add nslookup test with a delayed input
authorAram Sargsyan <aram@isc.org>
Fri, 5 May 2023 11:22:02 +0000 (11:22 +0000)
committerAram Sargsyan <aram@isc.org>
Tue, 20 Jun 2023 10:21:54 +0000 (10:21 +0000)
The added test checks the stdin input mode of nslookup with an
added delay to confirm that [GL #4044] is fixed.

bin/tests/system/nslookup/tests.sh

index 1978eb40f304303332dae019201561f03f570862..abde65c98feb3556b957bc2608733775942b8131 100644 (file)
@@ -44,6 +44,22 @@ grep "1.2.3.4" nslookup.out${n} > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
+# See [GL #4044]
+n=$((n+1))
+echo_i "Check A only lookup with a delayed stdin input ($n)"
+ret=0
+(sleep 6 && echo "server 10.53.0.1" && echo "a-only.example.net.") | $NSLOOKUP -port=${PORT} 2> nslookup.err${n} > nslookup.out${n} || ret=1
+lines=$(wc -l < nslookup.err${n})
+test $lines -eq 0 || ret=1
+lines=$(grep -c "Server:" nslookup.out${n})
+test $lines -eq 1 || ret=1
+lines=$(grep -c a-only.example.net nslookup.out${n})
+test $lines -eq 1 || ret=1
+grep "1.2.3.4" nslookup.out${n} > /dev/null || ret=1
+grep "timed out" nslookup.out${n} > /dev/null && ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status+ret))
+
 n=$((n+1))
 echo_i "Check AAAA only lookup ($n)"
 ret=0