exit-status.sh revision 1.2
1tid="remote exit status"
2
3for p in 1 2; do
4	for s in 0 1 4 5 44; do
5		trace "proto $p status $s"
6		ssh -$p -F $OBJ/ssh_proxy otherhost exit $s
7		r=$?
8		if [ $r -ne $s ]; then
9			fail "exit code mismatch for protocol $p: $r != $s"
10		fi
11
12		# same with early close of stdout/err
13		ssh -$p -F $OBJ/ssh_proxy -n otherhost \
14                	exec 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 protocol $p: $r != $s"
18		fi
19	done
20done
21