Save $? before case statement.
In some shells (FreeBSD 9, ash) the case statement resets $?, so save for later testing.
This commit is contained in:
parent
4c4e7f783b
commit
c6cb2565c9
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue