exit-status.sh 560 B

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