diff options
Diffstat (limited to 'bin/tests/system/coverage')
-rw-r--r-- | bin/tests/system/coverage/setup.sh | 40 | ||||
-rw-r--r-- | bin/tests/system/coverage/tests.sh | 100 |
2 files changed, 70 insertions, 70 deletions
diff --git a/bin/tests/system/coverage/setup.sh b/bin/tests/system/coverage/setup.sh index 7de73b8..84893ce 100644 --- a/bin/tests/system/coverage/setup.sh +++ b/bin/tests/system/coverage/setup.sh @@ -21,40 +21,40 @@ ln -s $CHECKZONE named-compilezone # Test 1: KSK goes inactive before successor is active dir=01-ksk-inactive ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) -$SETTIME -K $dir -I +9mo -D +1y $ksk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +1y $ksk1 >/dev/null 2>&1 ksk2=$($KEYGEN -q -K $dir -S $ksk1) -$SETTIME -K $dir -I +7mo $ksk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +7mo $ksk1 >/dev/null 2>&1 zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) # Test 2: ZSK goes inactive before successor is active dir=02-zsk-inactive zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) -$SETTIME -K $dir -I +9mo -D +1y $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +1y $zsk1 >/dev/null 2>&1 zsk2=$($KEYGEN -q -K $dir -S $zsk1) -$SETTIME -K $dir -I +7mo $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +7mo $zsk1 >/dev/null 2>&1 ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) # Test 3: KSK is unpublished before its successor is published dir=03-ksk-unpublished ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) -$SETTIME -K $dir -I +9mo -D +1y $ksk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +1y $ksk1 >/dev/null 2>&1 ksk2=$($KEYGEN -q -K $dir -S $ksk1) -$SETTIME -K $dir -D +6mo $ksk1 > /dev/null 2>&1 +$SETTIME -K $dir -D +6mo $ksk1 >/dev/null 2>&1 zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) # Test 4: ZSK is unpublished before its successor is published dir=04-zsk-unpublished zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) -$SETTIME -K $dir -I +9mo -D +1y $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +1y $zsk1 >/dev/null 2>&1 zsk2=$($KEYGEN -q -K $dir -S $zsk1) -$SETTIME -K $dir -D +6mo $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -D +6mo $zsk1 >/dev/null 2>&1 ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) # Test 5: KSK deleted and successor published before KSK is deactivated # and successor activated. dir=05-ksk-unpub-active ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) -$SETTIME -K $dir -I +9mo -D +8mo $ksk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +8mo $ksk1 >/dev/null 2>&1 ksk2=$($KEYGEN -q -K $dir -S $ksk1) zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) @@ -62,50 +62,50 @@ zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) # and successor activated. dir=06-zsk-unpub-active zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) -$SETTIME -K $dir -I +9mo -D +8mo $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +8mo $zsk1 >/dev/null 2>&1 zsk2=$($KEYGEN -q -K $dir -S $zsk1) ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) # Test 7: KSK rolled with insufficient delay after prepublication. dir=07-ksk-ttl ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) -$SETTIME -K $dir -I +9mo -D +1y $ksk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +1y $ksk1 >/dev/null 2>&1 ksk2=$($KEYGEN -q -K $dir -S $ksk1) # allow only 1 day between publication and activation -$SETTIME -K $dir -P +269d $ksk2 > /dev/null 2>&1 +$SETTIME -K $dir -P +269d $ksk2 >/dev/null 2>&1 zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) # Test 8: ZSK rolled with insufficient delay after prepublication. dir=08-zsk-ttl zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) -$SETTIME -K $dir -I +9mo -D +1y $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +1y $zsk1 >/dev/null 2>&1 zsk2=$($KEYGEN -q -K $dir -S $zsk1) # allow only 1 day between publication and activation -$SETTIME -K $dir -P +269d $zsk2 > /dev/null 2>&1 +$SETTIME -K $dir -P +269d $zsk2 >/dev/null 2>&1 ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) # Test 9: KSK goes inactive before successor is active, but checking ZSKs dir=09-check-zsk ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) -$SETTIME -K $dir -I +9mo -D +1y $ksk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +1y $ksk1 >/dev/null 2>&1 ksk2=$($KEYGEN -q -K $dir -S $ksk1) -$SETTIME -K $dir -I +7mo $ksk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +7mo $ksk1 >/dev/null 2>&1 zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) # Test 10: ZSK goes inactive before successor is active, but checking KSKs dir=10-check-ksk zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) -$SETTIME -K $dir -I +9mo -D +1y $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +9mo -D +1y $zsk1 >/dev/null 2>&1 zsk2=$($KEYGEN -q -K $dir -S $zsk1) -$SETTIME -K $dir -I +7mo $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +7mo $zsk1 >/dev/null 2>&1 ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) # Test 11: ZSK goes inactive before successor is active, but after cutoff dir=11-cutoff zsk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3 example.com) -$SETTIME -K $dir -I +18mo -D +2y $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +18mo -D +2y $zsk1 >/dev/null 2>&1 zsk2=$($KEYGEN -q -K $dir -S $zsk1) -$SETTIME -K $dir -I +16mo $zsk1 > /dev/null 2>&1 +$SETTIME -K $dir -I +16mo $zsk1 >/dev/null 2>&1 ksk1=$($KEYGEN -q -K $dir -a ${DEFAULT_ALGORITHM} -3fk example.com) # Test 12: Too early KSK deletion diff --git a/bin/tests/system/coverage/tests.sh b/bin/tests/system/coverage/tests.sh index e0da919..0f75b04 100644 --- a/bin/tests/system/coverage/tests.sh +++ b/bin/tests/system/coverage/tests.sh @@ -19,68 +19,68 @@ COVERAGE="$COVERAGE -c ./named-compilezone" status=0 n=1 -matchall () { - file=$1 - echo "$2" | while read matchline; do - grep "$matchline" $file > /dev/null 2>&1 || { - echo "FAIL" - return - } - done +matchall() { + file=$1 + echo "$2" | while read matchline; do + grep "$matchline" $file >/dev/null 2>&1 || { + echo "FAIL" + return + } + done } echo_i "checking for DNSSEC key coverage issues" ret=0 for dir in [0-9][0-9]-*; do - ret=0 - echo_i "$dir" - args= warn= error= ok= retcode= match= zones= - . $dir/expect - $COVERAGE $args -K $dir ${zones:-example.com} > coverage.$n 2>&1 + ret=0 + echo_i "$dir" + args= warn= error= ok= retcode= match= zones= + . $dir/expect + $COVERAGE $args -K $dir ${zones:-example.com} >coverage.$n 2>&1 - # check that return code matches expectations - found=$? - if [ $found -ne $retcode ]; then - echo "retcode was $found expected $retcode" - ret=1 - fi + # check that return code matches expectations + found=$? + if [ $found -ne $retcode ]; then + echo "retcode was $found expected $retcode" + ret=1 + fi - # check for correct number of errors - found=`grep ERROR coverage.$n | wc -l` - if [ $found -ne $error ]; then - echo "error count was $found expected $error" - ret=1 - fi + # check for correct number of errors + found=$(grep ERROR coverage.$n | wc -l) + if [ $found -ne $error ]; then + echo "error count was $found expected $error" + ret=1 + fi - # check for correct number of warnings - found=`grep WARNING coverage.$n | wc -l` - if [ $found -ne $warn ]; then - echo "warning count was $found expected $warn" - ret=1 - fi + # check for correct number of warnings + found=$(grep WARNING coverage.$n | wc -l) + if [ $found -ne $warn ]; then + echo "warning count was $found expected $warn" + ret=1 + fi - # check for correct number of OKs - found=`grep "No errors found" coverage.$n | wc -l` - if [ $found -ne $ok ]; then - echo "good count was $found expected $ok" - ret=1 - fi + # check for correct number of OKs + found=$(grep "No errors found" coverage.$n | wc -l) + if [ $found -ne $ok ]; then + echo "good count was $found expected $ok" + ret=1 + fi - found=`matchall coverage.$n "$match"` - if [ "$found" = "FAIL" ]; then - echo "no match on '$match'" - ret=1 - fi + found=$(matchall coverage.$n "$match") + if [ "$found" = "FAIL" ]; then + echo "no match on '$match'" + ret=1 + fi - found=`grep Traceback coverage.$n | wc -l` - if [ $found -ne 0 ]; then - echo "python exception detected" - ret=1 - fi + found=$(grep Traceback coverage.$n | wc -l) + if [ $found -ne 0 ]; then + echo "python exception detected" + ret=1 + fi - n=`expr $n + 1` - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` + n=$(expr $n + 1) + if [ $ret != 0 ]; then echo_i "failed"; fi + status=$(expr $status + $ret) done echo_i "exit status: $status" |