From 78639b2ddf90bbbf8489c7896dd8acb520222fab Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 15 Aug 2017 18:02:24 +1000 Subject: [PATCH] 'uname -o' is not portable, suppress error message; remove spurious cat tmp.out; provide forensics for failure analysis (cherry picked from commit e85a2c5624b514b64f7daedafa606baf27dc6ba2) --- bin/tests/system/metadata/clean.sh | 1 + bin/tests/system/metadata/tests.sh | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/bin/tests/system/metadata/clean.sh b/bin/tests/system/metadata/clean.sh index 66a5bb58e2..ee0e33abca 100644 --- a/bin/tests/system/metadata/clean.sh +++ b/bin/tests/system/metadata/clean.sh @@ -20,3 +20,4 @@ rm -f pending.key rolling.key standby.key inact.key rm -f prerev.key postrev.key oldstyle.key rm -f keys sigs rm -f tmp.out +rm -f settime1.test* settime2.test* diff --git a/bin/tests/system/metadata/tests.sh b/bin/tests/system/metadata/tests.sh index 231e11c402..079dbbab7d 100644 --- a/bin/tests/system/metadata/tests.sh +++ b/bin/tests/system/metadata/tests.sh @@ -22,7 +22,7 @@ SYSTEMTESTTOP=.. pzone=parent.nil pfile=parent.db czone=child.parent.nil cfile=child.db status=0 -n=0 +n=1 echo "I:setting key timers" $SETTIME -A now+15s `cat rolling.key` > /dev/null @@ -145,16 +145,21 @@ if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` echo "I:checking warning about permissions change on key with dnssec-settime ($n)" -ret=0 -# settime should print a warning about changing the permissions -chmod 644 `cat oldstyle.key`.private -$SETTIME -P none `cat oldstyle.key` > tmp.out 2>&1 || ret=1 -grep "warning" tmp.out > /dev/null 2>&1 || ret=1 -$SETTIME -P none `cat oldstyle.key` > tmp.out 2>&1 || ret=1 -grep "warning" tmp.out > /dev/null 2>&1 && ret=1 -n=`expr $n + 1` -if [ $ret != 0 ]; then echo "I:failed"; fi -status=`expr $status + $ret` +uname=`uname -o 2> /dev/null` +if [ Cygwin == "$uname" ]; then + echo "I: Cygwin detected, skipping" +else + ret=0 + # settime should print a warning about changing the permissions + chmod 644 `cat oldstyle.key`.private + $SETTIME -P none `cat oldstyle.key` > settime1.test$n 2>&1 || ret=1 + grep "warning: Permissions on the file.*have changed" settime1.test$n > /dev/null 2>&1 || ret=1 + $SETTIME -P none `cat oldstyle.key` > settime2.test$n 2>&1 || ret=1 + grep "warning: Permissions on the file.*have changed" settime2.test$n > /dev/null 2>&1 && ret=1 + n=`expr $n + 1` + if [ $ret != 0 ]; then echo "I:failed"; fi + status=`expr $status + $ret` +fi echo "I:checking warning about delete date < inactive date with dnssec-settime ($n)" ret=0