summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2021-09-03 04:11:14 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2021-09-03 04:11:14 +0000
commit8ad420b91f1d0afb568128b15fb5bf8c58890054 (patch)
tree0fb71da7d08e84fe601ea7046ae23c2d7904c9b6 /regress
parent4703c15ee89acdbc126902794f5e741650b47a6b (diff)
Add test for client termination status on signal.
Based on patch from Alexxz via github PR#235 with some tweaks, to match patch in bz#3281.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/ssh/Makefile3
-rw-r--r--regress/usr.bin/ssh/exit-status-signal.sh24
2 files changed, 26 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/Makefile b/regress/usr.bin/ssh/Makefile
index efebaef4f45..66b4bac4cc6 100644
--- a/regress/usr.bin/ssh/Makefile
+++ b/regress/usr.bin/ssh/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.116 2021/08/04 21:28:00 djm Exp $
+# $OpenBSD: Makefile,v 1.117 2021/09/03 04:11:13 dtucker Exp $
OPENSSL?= yes
@@ -25,6 +25,7 @@ LTESTS= connect \
proto-version \
proto-mismatch \
exit-status \
+ exit-status-signal \
envpass \
transfer \
banner \
diff --git a/regress/usr.bin/ssh/exit-status-signal.sh b/regress/usr.bin/ssh/exit-status-signal.sh
new file mode 100644
index 00000000000..1b3af0d84dd
--- /dev/null
+++ b/regress/usr.bin/ssh/exit-status-signal.sh
@@ -0,0 +1,24 @@
+# This test performs validation that ssh client is not successive on being terminated
+
+tid="exit status on signal"
+
+# spawn client in background
+rm -f $OBJ/remote_pid
+${SSH} -F $OBJ/ssh_proxy somehost 'echo $$ >'$OBJ'/remote_pid; sleep 444' &
+ssh_pid=$!
+
+# wait for it to start
+n=20
+while [ ! -f $OBJ/remote_pid ] && [ $n -gt 0 ]; do
+ n=$(($n - 1))
+ sleep 1
+done
+
+kill $ssh_pid
+wait $ssh_pid
+exit_code=$?
+
+if [ $exit_code -eq 0 ]; then
+ fail "ssh client should fail on signal"
+fi
+