From: Matthijs Mekking Date: Tue, 28 Jan 2020 14:52:08 +0000 (+0100) Subject: kasp test: Fix key id 0000 lookup X-Git-Tag: v9.16.0~19^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6eb28f629d8ee8b2864ede2c9c2e8c68ce833be;p=thirdparty%2Fbind9.git kasp test: Fix key id 0000 lookup When checking keys we search for keys by key id. The kasp test used key id 0 as an indicator that a key was not yet found. Use "no" instead. --- diff --git a/bin/tests/system/kasp/tests.sh b/bin/tests/system/kasp/tests.sh index a40c5375f27..7a7b4d9eb0e 100644 --- a/bin/tests/system/kasp/tests.sh +++ b/bin/tests/system/kasp/tests.sh @@ -507,6 +507,7 @@ for id in $ids; do test "$ret" -eq 0 && continue ret=0 && check_key "KEY3" "$id" + # If ret is still non-zero, non of the files matched. test "$ret" -eq 0 || echo_i "failed" status=$((status+ret)) @@ -767,9 +768,9 @@ check_keys() _log=0 # Clear key ids. - key_set KEY1 ID 0 - key_set KEY2 ID 0 - key_set KEY3 ID 0 + key_set KEY1 ID "no" + key_set KEY2 ID "no" + key_set KEY3 ID "no" # Check key files. _ids=$(get_keyids "$DIR" "$ZONE" "$_key_algnum") @@ -778,17 +779,17 @@ check_keys() # Check them until a match is found. echo_i "check key $_id" - if [ "0" = "$(key_get KEY1 ID)" ] && [ "$(key_get KEY1 EXPECT)" = "yes" ]; then + if [ "no" = "$(key_get KEY1 ID)" ] && [ "$(key_get KEY1 EXPECT)" = "yes" ]; then ret=0 check_key "KEY1" "$_id" test "$ret" -eq 0 && key_set KEY1 "ID" "$KEY_ID" && continue fi - if [ "0" = "$(key_get KEY2 ID)" ] && [ "$(key_get KEY2 EXPECT)" = "yes" ]; then + if [ "no" = "$(key_get KEY2 ID)" ] && [ "$(key_get KEY2 EXPECT)" = "yes" ]; then ret=0 check_key "KEY2" "$_id" test "$ret" -eq 0 && key_set KEY2 "ID" "$KEY_ID" && continue fi - if [ "0" = "$(key_get KEY3 ID)" ] && [ "$(key_get KEY3 EXPECT)" = "yes" ]; then + if [ "no" = "$(key_get KEY3 ID)" ] && [ "$(key_get KEY3 EXPECT)" = "yes" ]; then ret=0 check_key "KEY3" "$_id" test "$ret" -eq 0 && key_set KEY3 ID "$KEY_ID" && continue @@ -808,13 +809,13 @@ check_keys() ret=0 if [ "$(key_get KEY1 EXPECT)" = "yes" ]; then - test "0" = "$(key_get KEY1 ID)" && log_error "No KEY1 found for zone ${ZONE}" + test "no" = "$(key_get KEY1 ID)" && log_error "No KEY1 found for zone ${ZONE}" fi if [ "$(key_get KEY2 EXPECT)" = "yes" ]; then - test "0" = "$(key_get KEY2 ID)" && log_error "No KEY2 found for zone ${ZONE}" + test "no" = "$(key_get KEY2 ID)" && log_error "No KEY2 found for zone ${ZONE}" fi if [ "$(key_get KEY3 EXPECT)" = "yes" ]; then - test "0" = "$(key_get KEY3 ID)" && log_error "No KEY3 found for zone ${ZONE}" + test "no" = "$(key_get KEY3 ID)" && log_error "No KEY3 found for zone ${ZONE}" fi test "$ret" -eq 0 || echo_i "failed" status=$((status+ret))