summaryrefslogtreecommitdiff
path: root/regress/forwarding.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/forwarding.sh')
-rw-r--r--regress/forwarding.sh27
1 files changed, 13 insertions, 14 deletions
diff --git a/regress/forwarding.sh b/regress/forwarding.sh
index 592de7bc3..45c596d7d 100644
--- a/regress/forwarding.sh
+++ b/regress/forwarding.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: forwarding.sh,v 1.16 2016/04/14 23:57:17 djm Exp $ 1# $OpenBSD: forwarding.sh,v 1.19 2017/01/30 05:22:14 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="local and remote forwarding" 4tid="local and remote forwarding"
@@ -10,8 +10,7 @@ start_sshd
10base=33 10base=33
11last=$PORT 11last=$PORT
12fwd="" 12fwd=""
13make_tmpdir 13CTL=/tmp/openssh.regress.ctl-sock.$$
14CTL=$TMP/ctl-sock
15 14
16for j in 0 1 2; do 15for j in 0 1 2; do
17 for i in 0 1 2; do 16 for i in 0 1 2; do
@@ -38,7 +37,7 @@ for p in ${SSH_PROTOCOLS}; do
38 test -s ${COPY} || fail "failed copy of ${DATA}" 37 test -s ${COPY} || fail "failed copy of ${DATA}"
39 cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" 38 cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}"
40 39
41 ${SSH} -S $CTL -O exit somehost 40 ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost
42done 41done
43 42
44for p in ${SSH_PROTOCOLS}; do 43for p in ${SSH_PROTOCOLS}; do
@@ -53,7 +52,7 @@ for d in L R; do
53 -$d ${base}04:127.0.0.1:$PORT \ 52 -$d ${base}04:127.0.0.1:$PORT \
54 -oExitOnForwardFailure=yes somehost true 53 -oExitOnForwardFailure=yes somehost true
55 if [ $? != 0 ]; then 54 if [ $? != 0 ]; then
56 fail "connection failed, should not" 55 fatal "connection failed, should not"
57 else 56 else
58 # this one should fail 57 # this one should fail
59 ${SSH} -q -$p -F $OBJ/ssh_config \ 58 ${SSH} -q -$p -F $OBJ/ssh_config \
@@ -83,11 +82,11 @@ for p in ${SSH_PROTOCOLS}; do
83 fail "connection failed with cleared local forwarding" 82 fail "connection failed with cleared local forwarding"
84 else 83 else
85 # this one should fail 84 # this one should fail
86 ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 true \ 85 ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 somehost true \
87 >>$TEST_REGRESS_LOGFILE 2>&1 && \ 86 >>$TEST_REGRESS_LOGFILE 2>&1 && \
88 fail "local forwarding not cleared" 87 fail "local forwarding not cleared"
89 fi 88 fi
90 ${SSH} -S $CTL -O exit somehost 89 ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost
91 90
92 trace "clear remote forward proto $p" 91 trace "clear remote forward proto $p"
93 rm -f $CTL 92 rm -f $CTL
@@ -97,11 +96,11 @@ for p in ${SSH_PROTOCOLS}; do
97 fail "connection failed with cleared remote forwarding" 96 fail "connection failed with cleared remote forwarding"
98 else 97 else
99 # this one should fail 98 # this one should fail
100 ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 true \ 99 ${SSH} -$p -F $OBJ/ssh_config -p ${base}01 somehost true \
101 >>$TEST_REGRESS_LOGFILE 2>&1 && \ 100 >>$TEST_REGRESS_LOGFILE 2>&1 && \
102 fail "remote forwarding not cleared" 101 fail "remote forwarding not cleared"
103 fi 102 fi
104 ${SSH} -S $CTL -O exit somehost 103 ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost
105done 104done
106 105
107for p in 2; do 106for p in 2; do
@@ -127,7 +126,7 @@ for p in ${SSH_PROTOCOLS}; do
127 test -s ${COPY} || fail "failed copy of ${DATA}" 126 test -s ${COPY} || fail "failed copy of ${DATA}"
128 cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" 127 cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}"
129 128
130 ${SSH} -S $CTL -O exit somehost 129 ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost
131done 130done
132 131
133for p in 2; do 132for p in 2; do
@@ -143,8 +142,8 @@ for p in 2; do
143 test -s ${COPY} || fail "failed copy ${DATA}" 142 test -s ${COPY} || fail "failed copy ${DATA}"
144 cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" 143 cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}"
145 144
146 ${SSH} -S $CTL -O exit somehost 145 ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost
147 ${SSH} -S $CTL.1 -O exit somehost 146 ${SSH} -F $OBJ/ssh_config -S $CTL.1 -O exit somehost
148 ${SSH} -S $CTL.2 -O exit somehost 147 ${SSH} -F $OBJ/ssh_config -S $CTL.2 -O exit somehost
149 ${SSH} -S $CTL.3 -O exit somehost 148 ${SSH} -F $OBJ/ssh_config -S $CTL.3 -O exit somehost
150done 149done