summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2019-07-05 04:03:13 +0000
committerDarren Tucker <dtucker@dtucker.net>2019-07-05 15:06:04 +1000
commitde08335a4cfaa9b7081e94ea4a8b7153c230546d (patch)
tree49fbddbd9d5206919cedd6eca4014c55c1f15290
parent4d249284729f864faa2e8f3e015f9a41b674544a (diff)
upstream: Add a sleep to allow forwards to come up.
Currently when the multiplex client requests a forward it returns once the request has been sent but not necessarily when the forward is up. This causes intermittent text failures due to this race, so add some sleeps to mitigate this until we can fix it properly. OpenBSD-Regress-ID: 384c7d209d2443d25ea941d7f677e932621fb253
-rw-r--r--regress/multiplex.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/regress/multiplex.sh b/regress/multiplex.sh
index 29b5ef639..b5e604dba 100644
--- a/regress/multiplex.sh
+++ b/regress/multiplex.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: multiplex.sh,v 1.29 2019/01/01 22:20:16 djm Exp $ 1# $OpenBSD: multiplex.sh,v 1.30 2019/07/05 04:03:13 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4make_tmpdir 4make_tmpdir
@@ -81,6 +81,7 @@ trace "forward over TCP/IP and check result"
81$NC -N -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} > /dev/null & 81$NC -N -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} > /dev/null &
82netcat_pid=$! 82netcat_pid=$!
83${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L127.0.0.1:$((${PORT} + 2)):127.0.0.1:$((${PORT} + 1)) otherhost >>$TEST_SSH_LOGFILE 2>&1 83${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L127.0.0.1:$((${PORT} + 2)):127.0.0.1:$((${PORT} + 1)) otherhost >>$TEST_SSH_LOGFILE 2>&1
84sleep 1 # XXX remove once race fixed
84$NC 127.0.0.1 $((${PORT} + 2)) < /dev/null > ${COPY} 85$NC 127.0.0.1 $((${PORT} + 2)) < /dev/null > ${COPY}
85cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" 86cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}"
86kill $netcat_pid 2>/dev/null 87kill $netcat_pid 2>/dev/null
@@ -91,6 +92,7 @@ $NC -N -Ul $OBJ/unix-1.fwd < ${DATA} > /dev/null &
91netcat_pid=$! 92netcat_pid=$!
92${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 93${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1
93${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 94${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1
95sleep 1 # XXX remove once race fixed
94$NC -U $OBJ/unix-3.fwd < /dev/null > ${COPY} 96$NC -U $OBJ/unix-3.fwd < /dev/null > ${COPY}
95cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" 97cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}"
96kill $netcat_pid 2>/dev/null 98kill $netcat_pid 2>/dev/null
@@ -122,6 +124,7 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_REGRESS_LOGFILE 2>&1
122verbose "test $tid: cmd forward local (TCP)" 124verbose "test $tid: cmd forward local (TCP)"
123${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $P:localhost:$PORT otherhost \ 125${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $P:localhost:$PORT otherhost \
124 || fail "request local forward failed" 126 || fail "request local forward failed"
127sleep 1 # XXX remove once race fixed
125${SSH} -F $OBJ/ssh_config -p$P otherhost true \ 128${SSH} -F $OBJ/ssh_config -p$P otherhost true \
126 || fail "connect to local forward port failed" 129 || fail "connect to local forward port failed"
127${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $P:localhost:$PORT otherhost \ 130${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $P:localhost:$PORT otherhost \
@@ -132,6 +135,7 @@ ${SSH} -F $OBJ/ssh_config -p$P otherhost true \
132verbose "test $tid: cmd forward remote (TCP)" 135verbose "test $tid: cmd forward remote (TCP)"
133${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $P:localhost:$PORT otherhost \ 136${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $P:localhost:$PORT otherhost \
134 || fail "request remote forward failed" 137 || fail "request remote forward failed"
138sleep 1 # XXX remove once race fixed
135${SSH} -F $OBJ/ssh_config -p$P otherhost true \ 139${SSH} -F $OBJ/ssh_config -p$P otherhost true \
136 || fail "connect to remote forwarded port failed" 140 || fail "connect to remote forwarded port failed"
137${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $P:localhost:$PORT otherhost \ 141${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $P:localhost:$PORT otherhost \
@@ -142,6 +146,7 @@ ${SSH} -F $OBJ/ssh_config -p$P otherhost true \
142verbose "test $tid: cmd forward local (UNIX)" 146verbose "test $tid: cmd forward local (UNIX)"
143${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \ 147${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \
144 || fail "request local forward failed" 148 || fail "request local forward failed"
149sleep 1 # XXX remove once race fixed
145echo "" | $NC -U $OBJ/unix-1.fwd | \ 150echo "" | $NC -U $OBJ/unix-1.fwd | \
146 grep "Invalid SSH identification string" >/dev/null 2>&1 \ 151 grep "Invalid SSH identification string" >/dev/null 2>&1 \
147 || fail "connect to local forward path failed" 152 || fail "connect to local forward path failed"
@@ -154,6 +159,7 @@ rm -f $OBJ/unix-1.fwd
154verbose "test $tid: cmd forward remote (UNIX)" 159verbose "test $tid: cmd forward remote (UNIX)"
155${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ 160${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \
156 || fail "request remote forward failed" 161 || fail "request remote forward failed"
162sleep 1 # XXX remove once race fixed
157echo "" | $NC -U $OBJ/unix-1.fwd | \ 163echo "" | $NC -U $OBJ/unix-1.fwd | \
158 grep "Invalid SSH identification string" >/dev/null 2>&1 \ 164 grep "Invalid SSH identification string" >/dev/null 2>&1 \
159 || fail "connect to remote forwarded path failed" 165 || fail "connect to remote forwarded path failed"