2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Merge branch '1589-intermittent-kasp-failure-keyid-0' into 'master'

kasp test: Fix key id 0000 lookup

Closes #1589

See merge request isc-projects/bind9!2968
This commit is contained in:
Matthijs Mekking
2020-02-07 15:09:58 +00:00
2 changed files with 26 additions and 24 deletions

View File

@@ -648,6 +648,7 @@ $SIGNER -S -z -x -s now-1h -e now+30d -o $zone -O full -f $zonefile $infile > si
setup step6.csk-roll2.autosign
CSK1=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $zone 2> keygen.out.$zone.1)
CSK2=$($KEYGEN -k csk-roll2 -l policies/autosign.conf $zone 2> keygen.out.$zone.1)
# Substract DNSKEY TTL plus zone propagation delay (2h).
TactN="now-4678h"
TretN="now-214h"

View File

@@ -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))