1 # $OpenBSD: exit-status.sh,v 1.8 2017/04/30 23:34:55 djm Exp $
2 # Placed in the Public Domain.
4 tid="remote exit status"
6 for s in 0 1 4 5 44; do
8 verbose "test $tid: status $s"
9 ${SSH} -F $OBJ/ssh_proxy otherhost exit $s
11 if [ $r -ne $s ]; then
12 fail "exit code mismatch for: $r != $s"
15 # same with early close of stdout/err
16 ${SSH} -F $OBJ/ssh_proxy -n otherhost exec \
17 sh -c \'"sleep 2; exec > /dev/null 2>&1; sleep 3; exit $s"\'
19 if [ $r -ne $s ]; then
20 fail "exit code (with sleep) mismatch for: $r != $s"