summaryrefslogtreecommitdiff
path: root/regress/key-options.sh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-03-22 17:00:28 +1100
committerDarren Tucker <dtucker@dtucker.net>2018-03-22 17:00:28 +1100
commitc6cb2565c9285eb54fa9dfbb3890f5464aff410f (patch)
tree7836f40c3a7ee5b3d148778e2ecace572c24d5d3 /regress/key-options.sh
parent4c4e7f783b43b264c247233acb887ee10ed4ce4d (diff)
Save $? before case statement.
In some shells (FreeBSD 9, ash) the case statement resets $?, so save for later testing.
Diffstat (limited to 'regress/key-options.sh')
-rw-r--r--regress/key-options.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/regress/key-options.sh b/regress/key-options.sh
index e03cae58..d680737c 100644
--- a/regress/key-options.sh
+++ b/regress/key-options.sh
@@ -101,9 +101,10 @@ check_valid_before() {
sed "s/.*/$opts &/" $origkeys >$authkeys
verbose "key option expiry-time $which"
${SSH} -q -F $OBJ/ssh_proxy somehost true
+ r=$?
case "$expect" in
- fail) test $? -eq 0 && fail "key option succeeded $which" ;;
- pass) test $? -ne 0 && fail "key option failed $which" ;;
+ fail) test $r -eq 0 && fail "key option succeeded $which" ;;
+ pass) test $r -ne 0 && fail "key option failed $which" ;;
*) fatal "unknown expectation $expect" ;;
esac
}