From: Aram Sargsyan Date: Tue, 11 Mar 2025 14:29:22 +0000 (+0000) Subject: Test -T cookiealwaysvalid X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7010948de9c9669de23c6204e37f4f6bf25f5b6f;p=thirdparty%2Fbind9.git Test -T cookiealwaysvalid Add a check in the "cookie" system test to make sure that the new '-T cookiealwaysvalid' option works. (cherry picked from commit 4e75a20b6a63c3840559accc9df2af2d50a747f6) --- diff --git a/bin/tests/system/cookie/clean.sh b/bin/tests/system/cookie/clean.sh index 2c107573c9a..cc7144d4e56 100644 --- a/bin/tests/system/cookie/clean.sh +++ b/bin/tests/system/cookie/clean.sh @@ -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 diff --git a/bin/tests/system/cookie/tests.sh b/bin/tests/system/cookie/tests.sh index 65415072c79..53eb41ea1ec 100755 --- a/bin/tests/system/cookie/tests.sh +++ b/bin/tests/system/cookie/tests.sh @@ -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