[openssh-commits] [openssh] 03/03: upstream: Add test for client termination status on signal.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Sep 3 14:39:51 AEST 2021


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 7cc3fe28896e653956a6a2eed0a25d551b83a029
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Fri Sep 3 04:11:13 2021 +0000

    upstream: 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.
    
    OpenBSD-Regress-ID: d87c7446fb8b5f8b45894fbbd6875df326e729e2
---
 regress/Makefile              |  3 ++-
 regress/exit-status-signal.sh | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/regress/Makefile b/regress/Makefile
index 810d74ce..0b5ad45d 100644
--- a/regress/Makefile
+++ b/regress/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 $
 
 tests:		prep file-tests t-exec unit
 
@@ -27,6 +27,7 @@ LTESTS= 	connect \
 		proto-version \
 		proto-mismatch \
 		exit-status \
+		exit-status-signal \
 		envpass \
 		transfer \
 		banner \
diff --git a/regress/exit-status-signal.sh b/regress/exit-status-signal.sh
new file mode 100644
index 00000000..1b3af0d8
--- /dev/null
+++ b/regress/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
+

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list