From: Matthijs Mekking Date: Wed, 19 Jun 2024 13:58:19 +0000 (+0200) Subject: Add option to kasp.sh check_keys to retain found keys X-Git-Tag: v9.21.1~23^2~10 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=ecd2b79106cc5f2d7704b50df7a334f6d43a7387;p=thirdparty%2Fbind9.git Add option to kasp.sh check_keys to retain found keys This will come in handy when we are testing offline-ksk where first we check for ZSKs and then the KSK. --- diff --git a/bin/tests/system/kasp.sh b/bin/tests/system/kasp.sh index 4177f208027..7235541157e 100644 --- a/bin/tests/system/kasp.sh +++ b/bin/tests/system/kasp.sh @@ -754,10 +754,12 @@ _check_keys() { _ret=0 # Clear key ids. - key_set KEY1 ID "no" - key_set KEY2 ID "no" - key_set KEY3 ID "no" - key_set KEY4 ID "no" + if [ "$1" != "keep" ]; then + key_set KEY1 ID "no" + key_set KEY2 ID "no" + key_set KEY3 ID "no" + key_set KEY4 ID "no" + fi # Check key files. _ids=$(get_keyids "$DIR" "$ZONE") @@ -808,6 +810,9 @@ _check_keys() { # Found key identifiers are stored in the right key array. # Keys are found if they are stored inside $DIR or in a subdirectory up to # three levels deeper. +# +# If $1 is set, we keep keys that are already found and don't look for them +# again. check_keys() { n=$((n + 1)) echo_i "check keys are created for zone ${ZONE} ($n)" @@ -824,7 +829,7 @@ check_keys() { # Temporarily don't log errors because we are searching multiple files. disable_logerror - retry_quiet 3 _check_keys || ret=1 + retry_quiet 3 _check_keys $1 || ret=1 test "$ret" -eq 0 || echo_i "failed" status=$((status + ret))