[openssh-commits] [openssh] 02/03: upstream: add some more synchronisation to avoid a race between

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Oct 21 19:36:41 AEDT 2025


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

djm pushed a commit to branch master
in repository openssh.

commit d1d8144ea682adae5c3bb2994322fa524584ce8b
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Tue Oct 21 08:34:52 2025 +0000

    upstream: add some more synchronisation to avoid a race between
    
    command entry and ^C that showed up on the portable regress tests.
    
    OpenBSD-Regress-ID: 5527e74aed1b008aa7e5223ca5a84aedecd973d4
---
 regress/ssh-tty.sh | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/regress/ssh-tty.sh b/regress/ssh-tty.sh
index 690794c9e..866e92287 100644
--- a/regress/ssh-tty.sh
+++ b/regress/ssh-tty.sh
@@ -1,4 +1,4 @@
-#	$OpenBSD: ssh-tty.sh,v 1.1 2025/10/20 00:45:10 djm Exp $
+#	$OpenBSD: ssh-tty.sh,v 1.2 2025/10/21 08:34:52 djm Exp $
 #	Placed in the Public Domain.
 
 # Basic TTY smoke test
@@ -30,6 +30,8 @@ MAGIC3="woLF1701d"
 MAGIC3_OCTAL="\167\157\114\106\061\067\060\061\144"
 MAGIC4="lUh4thX4evR"
 MAGIC4_OCTAL="\154\125\150\064\164\150\130\064\145\166\122"
+MAGIC5="AllMo1000x"
+MAGIC5_OCTAL="\101\154\154\115\157\061\060\060\060\170"
 
 # Wait for a mux process to become ready.
 wait_for_mux_ready()
@@ -90,7 +92,7 @@ run_test() {
 	# Prepare a tmux session.
 	$TMUX_TEST kill-session -t $sess 2>/dev/null
 	$TMUX_TEST new-session -d -s $sess
-	#echo XXXXXXXXXX $sess; sleep 10
+	# echo XXXXXXXXXX $TMUX_TEST attach -t $sess; sleep 10
 
 	# Command to start SSH; sent as keystrokes to tmux session.
 	RCMD="$CLEANENV $SHELL"
@@ -108,13 +110,15 @@ run_test() {
 	verbose "${tag}: ^c interrupts process"
 	# ^c should interrupt the sleep and prevent the magic string
 	# from appearing.
-	$TMUX_TEST send-keys -t $sess "sleep 30 || printf '$MAGIC3_OCTAL\n'"
+	$TMUX_TEST send-keys -t $sess \
+		"printf '$MAGIC3_OCTAL' ; sleep 30 || printf '$MAGIC4_OCTAL\n'"
 	$TMUX_TEST send-keys -t $sess ENTER
+	wait_for_regex "$MAGIC3" # Command has executed.
 	$TMUX_TEST send-keys -t $sess "C-c"
 	# send another string to let us know that the sleep has finished.
-	$TMUX_TEST send-keys -t $sess "printf '$MAGIC4_OCTAL\n'" ENTER
-	wait_for_regex "$MAGIC4"
-	not_in_term "$MAGIC3" "^c did not interrupt"
+	$TMUX_TEST send-keys -t $sess "printf '$MAGIC5_OCTAL\n'" ENTER
+	wait_for_regex "$MAGIC5"
+	not_in_term "$MAGIC4" "^c did not interrupt"
 
 	verbose "${tag}: ~? produces help"
 	$TMUX_TEST send-keys -t $sess ENTER "~?"
@@ -143,6 +147,7 @@ not_in_term "$MAGIC1" "terminal already contains magic1 string" fatal
 not_in_term "$MAGIC2" "terminal already contains magic2 string" fatal
 not_in_term "$MAGIC3" "terminal already contains magic3 string" fatal
 not_in_term "$MAGIC4" "terminal already contains magic4 string" fatal
+not_in_term "$MAGIC5" "terminal already contains magic5 string" fatal
 not_in_term "^Supported escape" "terminal already contains escape help" fatal
 $TMUX_TEST send-keys -t $sess "printf '$MAGIC1_OCTAL\n'" ENTER
 wait_for_regex "$MAGIC1" fatal

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


More information about the openssh-commits mailing list