summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm <djm>2014-07-21 00:23:27 +0000
committerdjm <djm>2014-07-21 00:23:27 +0000
commita2a36e49d38f3f47b6bec39de221ac8f1167a46a (patch)
tree3c2eb250f119e420006724a00a7a669a5929d180
parentaf464809e31f4c65cf3164344146958757288c90 (diff)
downloadopenssh-a2a36e49d38f3f47b6bec39de221ac8f1167a46a.tar.gz
- (djm) [regress/multiplex.sh] Not all netcat accept the -N option.
-rw-r--r--ChangeLog1
-rw-r--r--regress/multiplex.sh30
2 files changed, 22 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a22bef55..dcd8d3ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
of the streamlocal patches by William Ahern from:
http://www.25thandclement.com/~william/projects/streamlocal.html
OK djm@ markus@
+ - (djm) [regress/multiplex.sh] Not all netcat accept the -N option.
20140721
- (dtucker) [cipher.c openbsd-compat/openssl-compat.h] Restore the bits
diff --git a/regress/multiplex.sh b/regress/multiplex.sh
index 9f5fc38e..5ef9049d 100644
--- a/regress/multiplex.sh
+++ b/regress/multiplex.sh
@@ -5,6 +5,18 @@ CTL=/tmp/openssh.regress.ctl-sock.$$
tid="connection multiplexing"
+if have_prog nc ; then
+ if nc -h 2>&1 | grep -- -N >/dev/null; then
+ NC="nc -N";
+ else
+ NC="nc"
+ fi
+else
+ echo "skipped (no nc found)"
+ exit 0
+fi
+
+trace "will use ProxyCommand $proxycmd"
if config_defined DISABLE_FD_PASSING ; then
echo "skipped (not supported on this platform)"
exit 0
@@ -27,7 +39,7 @@ start_sshd
start_mux_master()
{
trace "start master, fork to background"
- ${SSH} -Nn2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \
+ ${SSH} -n2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \
-E $TEST_REGRESS_LOGFILE 2>&1 &
# NB. $SSH_PID will be killed by test-exec.sh:cleanup on fatal errors.
SSH_PID=$!
@@ -74,20 +86,20 @@ cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}"
rm -f ${COPY}
verbose "test $tid: forward"
trace "forward over TCP/IP and check result"
-nc -N -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} &
+$NC -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} &
netcat_pid=$!
${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
-nc 127.0.0.1 $((${PORT} + 2)) > ${COPY}
+$NC 127.0.0.1 $((${PORT} + 2)) > ${COPY}
cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}"
kill $netcat_pid 2>/dev/null
rm -f ${COPY} $OBJ/unix-[123].fwd
trace "forward over UNIX and check result"
-nc -N -Ul $OBJ/unix-1.fwd < ${DATA} &
+$NC -Ul $OBJ/unix-1.fwd < ${DATA} &
netcat_pid=$!
${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1
${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1
-nc -U $OBJ/unix-3.fwd > ${COPY}
+$NC -U $OBJ/unix-3.fwd > ${COPY}
cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}"
kill $netcat_pid 2>/dev/null
rm -f ${COPY} $OBJ/unix-[123].fwd
@@ -138,22 +150,22 @@ ${SSH} -F $OBJ/ssh_config -p$P otherhost true \
verbose "test $tid: cmd forward local (UNIX)"
${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \
|| fail "request local forward failed"
-echo "" | nc -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \
+echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \
|| fail "connect to local forward path failed"
${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \
|| fail "cancel local forward failed"
-N=$(echo "" | nc -U $OBJ/unix-1.fwd 2>&1 | wc -l)
+N=$(echo "" | $NC -U $OBJ/unix-1.fwd 2>&1 | wc -l)
test ${N} -eq 0 || fail "local forward path still listening"
rm -f $OBJ/unix-1.fwd
verbose "test $tid: cmd forward remote (UNIX)"
${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \
|| fail "request remote forward failed"
-echo "" | nc -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \
+echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \
|| fail "connect to remote forwarded path failed"
${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \
|| fail "cancel remote forward failed"
-N=$(echo "" | nc -U $OBJ/unix-1.fwd 2>&1 | wc -l)
+N=$(echo "" | $NC -U $OBJ/unix-1.fwd 2>&1 | wc -l)
test ${N} -eq 0 || fail "remote forward path still listening"
rm -f $OBJ/unix-1.fwd