diff options
Diffstat (limited to 'regress/multiplex.sh')
-rw-r--r-- | regress/multiplex.sh | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 8ee140be6..acb9234d9 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh | |||
@@ -1,24 +1,11 @@ | |||
1 | # $OpenBSD: multiplex.sh,v 1.25 2014/07/22 01:32:12 djm Exp $ | 1 | # $OpenBSD: multiplex.sh,v 1.27 2014/12/22 06:14:29 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | CTL=/tmp/openssh.regress.ctl-sock.$$ | 4 | CTL=/tmp/openssh.regress.ctl-sock.$$ |
5 | 5 | ||
6 | tid="connection multiplexing" | 6 | tid="connection multiplexing" |
7 | 7 | ||
8 | if have_prog nc ; then | 8 | NC=$OBJ/netcat |
9 | if nc -h 2>&1 | grep -- -N >/dev/null; then | ||
10 | NC="nc -N"; | ||
11 | elif nc -h 2>&1 | grep -- "-U.*Use UNIX" >/dev/null ; then | ||
12 | NC="nc" | ||
13 | else | ||
14 | echo "nc is incompatible" | ||
15 | fi | ||
16 | fi | ||
17 | |||
18 | if test -z "$NC" ; then | ||
19 | echo "skipped (no compatible nc found)" | ||
20 | exit 0 | ||
21 | fi | ||
22 | 9 | ||
23 | trace "will use ProxyCommand $proxycmd" | 10 | trace "will use ProxyCommand $proxycmd" |
24 | if config_defined DISABLE_FD_PASSING ; then | 11 | if config_defined DISABLE_FD_PASSING ; then |
@@ -90,20 +77,20 @@ cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" | |||
90 | rm -f ${COPY} | 77 | rm -f ${COPY} |
91 | verbose "test $tid: forward" | 78 | verbose "test $tid: forward" |
92 | trace "forward over TCP/IP and check result" | 79 | trace "forward over TCP/IP and check result" |
93 | $NC -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} & | 80 | $NC -N -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} > /dev/null & |
94 | netcat_pid=$! | 81 | netcat_pid=$! |
95 | ${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 | 82 | ${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 |
96 | $NC -d 127.0.0.1 $((${PORT} + 2)) > ${COPY} < /dev/null | 83 | $NC 127.0.0.1 $((${PORT} + 2)) < /dev/null > ${COPY} |
97 | cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" | 84 | cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" |
98 | kill $netcat_pid 2>/dev/null | 85 | kill $netcat_pid 2>/dev/null |
99 | rm -f ${COPY} $OBJ/unix-[123].fwd | 86 | rm -f ${COPY} $OBJ/unix-[123].fwd |
100 | 87 | ||
101 | trace "forward over UNIX and check result" | 88 | trace "forward over UNIX and check result" |
102 | $NC -Ul $OBJ/unix-1.fwd < ${DATA} & | 89 | $NC -N -Ul $OBJ/unix-1.fwd < ${DATA} > /dev/null & |
103 | netcat_pid=$! | 90 | netcat_pid=$! |
104 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 | 91 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 |
105 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 | 92 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 |
106 | $NC -d -U $OBJ/unix-3.fwd > ${COPY} </dev/null | 93 | $NC -U $OBJ/unix-3.fwd < /dev/null > ${COPY} 2>/dev/null |
107 | cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" | 94 | cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" |
108 | kill $netcat_pid 2>/dev/null | 95 | kill $netcat_pid 2>/dev/null |
109 | rm -f ${COPY} $OBJ/unix-[123].fwd | 96 | rm -f ${COPY} $OBJ/unix-[123].fwd |