]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test -T cookiealwaysvalid
authorAram Sargsyan <aram@isc.org>
Tue, 11 Mar 2025 14:29:22 +0000 (14:29 +0000)
committerAram Sargsyan <aram@isc.org>
Mon, 17 Mar 2025 13:29:03 +0000 (13:29 +0000)
Add a check in the "cookie" system test to make sure that the new
'-T cookiealwaysvalid' option works.

(cherry picked from commit 4e75a20b6a63c3840559accc9df2af2d50a747f6)

bin/tests/system/cookie/clean.sh
bin/tests/system/cookie/tests.sh

index 9364329c490b6d69c05c60341a11154c3498bda0..38c7a60275bd4c15ba3a5692ffc86c7ba632ab16 100644 (file)
@@ -12,6 +12,7 @@ rm -f dig.out.*
 rm -f named.run.*
 rm -f rndc.out.*
 rm -f ns1/named_dump.db*
+rm -f ns4/named.cookiealwaysvalid
 rm -f ns*/named.memstats
 rm -f ns*/named.run
 rm -f ns*/named.lock
index d01a8d5e4b9b8d0b57f3b490995a4d0fc66e2477..08e779c0cf1f7eaeafa1bf3689e2479cb93829cc 100755 (executable)
@@ -303,6 +303,23 @@ grep "status: NOERROR," dig.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "Restart NS4 with -T cookiealwaysvalid ($n)"
+$PERL $SYSTEMTESTTOP/stop.pl cookie ns4
+touch ns4/named.cookiealwaysvalid
+$PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} cookie ns4 || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
+n=`expr $n + 1`
+echo_i "test NS6 cookie on NS4 with -T cookiealwaysvalid (expect success) ($n)"
+ret=0
+$DIG $DIGOPTS +cookie=$ns6cookie -b 10.53.0.4 +nobadcookie soa . @10.53.0.4 >dig.out.test$n || ret=1
+grep "; COOKIE:.*(good)" dig.out.test$n >/dev/null || ret=1
+grep "status: NOERROR," dig.out.test$n >/dev/null || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 n=`expr $n + 1`
 echo_i "check that test server is correctly configured ($n)"
 ret=0