]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix kasp system test bugs
authorMatthijs Mekking <matthijs@isc.org>
Mon, 11 Jul 2022 08:18:56 +0000 (10:18 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Tue, 12 Jul 2022 09:29:03 +0000 (11:29 +0200)
Fix a comment, ensuring the right parameters are used (zone is
parameter $3, not $2) and add view and policy parameters to the comment.

Fix the view tests and test the correct view (example3 instead of
example2).

Fix placement of "n=$((n+1)" for two test cases.

bin/tests/system/kasp.sh
bin/tests/system/kasp/tests.sh

index 785b69c770d03116517f83c7282d039e87675778..f4058f6400556945e798e758a5d698be34644328 100644 (file)
@@ -823,9 +823,9 @@ check_keys() {
        status=$((status+ret))
 }
 
-# Call rndc dnssec -status on server $1 for zone $2 and check output.
-# This is a loose verification, it just tests if the right policy
-# name is returned, and if all expected keys are listed.  The rndc
+# Call rndc dnssec -status on server $1 for zone $3 in view $4 with policy $2
+# and check output. This is a loose verification, it just tests if the right
+# policy name is returned, and if all expected keys are listed.  The rndc
 # dnssec -status output also lists whether a key is published,
 # used for signing, is retired, or is removed, and if not when
 # it is scheduled to do so, and it shows the states for the various
index 6d63c5d70dc7cc405a5f907596b8dc16c5361fba..52007245bbfcd5530960e929336464e0fbed99e0 100644 (file)
@@ -1911,12 +1911,12 @@ status=$((status+ret))
 TSIG="$DEFAULT_HMAC:keyforview3:$VIEW3"
 wait_for_nsec
 check_keys
-check_dnssecstatus "$SERVER" "$POLICY" "$ZONE" "example2"
+check_dnssecstatus "$SERVER" "$POLICY" "$ZONE" "example3"
 check_apex
 dnssec_verify
 n=$((n+1))
 # check subdomain
-echo_i "check TXT example.net (in-view example2) rrset is signed correctly ($n)"
+echo_i "check TXT example.net (view example3) rrset is signed correctly ($n)"
 ret=0
 dig_with_opts "view.${ZONE}" "@${SERVER}" TXT > "dig.out.$DIR.test$n.txt" || log_error "dig view.${ZONE} TXT failed"
 grep "status: NOERROR" "dig.out.$DIR.test$n.txt" > /dev/null || log_error "mismatch status in DNS response"
@@ -4671,6 +4671,7 @@ _check_soa_ttl() {
        test ${ttl2:-0} -eq $2 || return 1
 }
 
+n=$((n+1))
 echo_i "Check that 'rndc reload' of just the serial updates the signed instance ($n)"
 TSIG=
 ret=0
@@ -4684,8 +4685,8 @@ wait_for_log 3 "all zones loaded" ns6/named.run
 retry_quiet 10 _check_soa_ttl 300 300 || ret=1
 test "$ret" -eq 0 || echo_i "failed"
 status=$((status+ret))
-n=$((n+1))
 
+n=$((n+1))
 echo_i "Check that restart with zone changes and deleted journal works ($n)"
 TSIG=
 ret=0
@@ -4702,7 +4703,6 @@ wait_for_log 3 "all zones loaded" ns6/named.run
 retry_quiet 10 _check_soa_ttl 300 400 || ret=1
 test "$ret" -eq 0 || echo_i "failed"
 status=$((status+ret))
-n=$((n+1))
 
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1