]> 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 12:15:24 +0000 (12:15 +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 2c107573c9a9dbbb9b8890a79c0d0d5c68c99992..cc7144d4e56d2abc1f3586cca39eea63b6b7fc4f 100644 (file)
@@ -16,6 +16,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 65415072c79e60fe0da2c2f13f062cad27549533..53eb41ea1ec06100794bb77548e8858521f60115 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)"
+stop_server ns4
+touch ns4/named.cookiealwaysvalid
+start_server --noclean --restart --port ${PORT} 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