]> 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 10:42:47 +0000 (10:42 +0000)
Add a check in the "cookie" system test to make sure that the new
'-T cookiealwaysvalid' option works.

bin/tests/system/cookie/tests.sh
bin/tests/system/cookie/tests_sh_cookie.py

index 73473885f09f08d553f990d2f5e70e7c97fa2656..5c08beb05c85298b7979c96089380330e5a2cf00 100755 (executable)
@@ -361,6 +361,23 @@ grep "status: NOERROR," dig.out.test$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+n=$((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=$((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=$((n + 1))
 echo_i "check that test server is correctly configured ($n)"
 ret=0
index 768f8601ed1f80274d8af2a066a2dc6cfbd97031..1c9e8280f5db7de302ce642d0e6a439e4871a41d 100644 (file)
@@ -19,6 +19,7 @@ pytestmark = pytest.mark.extra_artifacts(
         "ans*/ans.run",
         "ans*/query.log",
         "ns1/named_dump.db*",
+        "ns4/named.cookiealwaysvalid",
     ]
 )