mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Handle non-zero return codes in rootkeysentinel tests
(cherry picked from commit d203681a75)
This commit is contained in:
parent
17f6a849ab
commit
02edc985cf
2 changed files with 8 additions and 13 deletions
|
|
@ -11,13 +11,10 @@
|
|||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
# leave as expr as expr treats arguments with leading 0's as base 10
|
||||
# handle exit code 1 from expr when the result is 0
|
||||
oldid=${1:-00000}
|
||||
newid=$(expr \( ${oldid} + 1000 \) % 65536 || true)
|
||||
newid=$(expr "0000${newid}" : '.*\(.....\)$') # prepend leading 0's
|
||||
badid=$(expr \( ${oldid} + 7777 \) % 65536 || true)
|
||||
badid=$(expr "0000${badid}" : '.*\(.....\)$') # prepend leading 0's
|
||||
oldid=$(echo ${1:-0} | sed 's/^0*//')
|
||||
newid=$(printf '%05u' $(((oldid + 1000) % 65536)))
|
||||
badid=$(printf '%05u' $(((oldid + 7777) % 65536)))
|
||||
oldid=$(printf '%05u' $((oldid + 0)))
|
||||
|
||||
. ../../conf.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -38,12 +38,10 @@ newtest() {
|
|||
|
||||
newtest "get test ids"
|
||||
$DIG $DIGOPTS . dnskey +short +rrcomm @10.53.0.1 > dig.out.ns1.test$n || ret=1
|
||||
oldid=`sed -n 's/.*key id = //p' < dig.out.ns1.test$n`
|
||||
oldid=`expr "0000${oldid}" : '.*\(.....\)$'`
|
||||
newid=`expr \( ${oldid} + 1000 \) % 65536`
|
||||
newid=`expr "0000${newid}" : '.*\(.....\)$'`
|
||||
badid=`expr \( ${oldid} + 7777 \) % 65536`
|
||||
badid=`expr "0000${badid}" : '.*\(.....\)$'`
|
||||
oldid=$(sed -n 's/.*key id = //p' < dig.out.ns1.test$n)
|
||||
newid=$(printf "%05u" $(((oldid + 1000) % 65536)))
|
||||
badid=$(printf "%05u" $(((oldid + 7777) % 65536)))
|
||||
oldid=$(printf "%05u" $((oldid + 0)))
|
||||
echo_i "test id: oldid=${oldid} (configured)"
|
||||
echo_i "test id: newid=${newid} (not configured)"
|
||||
echo_i "test id: badid=${badid}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue