summaryrefslogtreecommitdiff
path: root/regress/forwarding.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/forwarding.sh')
-rw-r--r--regress/forwarding.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/regress/forwarding.sh b/regress/forwarding.sh
index f799d4951..fb4f35aff 100644
--- a/regress/forwarding.sh
+++ b/regress/forwarding.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: forwarding.sh,v 1.12 2014/07/15 15:54:15 millert Exp $ 1# $OpenBSD: forwarding.sh,v 1.15 2015/03/03 22:35:19 markus 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,6 +10,9 @@ start_sshd
10base=33 10base=33
11last=$PORT 11last=$PORT
12fwd="" 12fwd=""
13CTL=$OBJ/ctl-sock
14rm -f $CTL
15
13for j in 0 1 2; do 16for j in 0 1 2; do
14 for i in 0 1 2; do 17 for i in 0 1 2; do
15 a=$base$j$i 18 a=$base$j$i
@@ -20,8 +23,11 @@ for j in 0 1 2; do
20 last=$a 23 last=$a
21 done 24 done
22done 25done
23for p in 1 2; do 26for p in ${SSH_PROTOCOLS}; do
24 q=`expr 3 - $p` 27 q=`expr 3 - $p`
28 if ! ssh_version $q; then
29 q=$p
30 fi
25 trace "start forwarding, fork to background" 31 trace "start forwarding, fork to background"
26 ${SSH} -$p -F $OBJ/ssh_config -f $fwd somehost sleep 10 32 ${SSH} -$p -F $OBJ/ssh_config -f $fwd somehost sleep 10
27 33
@@ -34,7 +40,7 @@ for p in 1 2; do
34 sleep 10 40 sleep 10
35done 41done
36 42
37for p in 1 2; do 43for p in ${SSH_PROTOCOLS}; do
38for d in L R; do 44for d in L R; do
39 trace "exit on -$d forward failure, proto $p" 45 trace "exit on -$d forward failure, proto $p"
40 46
@@ -64,7 +70,7 @@ for d in L R; do
64done 70done
65done 71done
66 72
67for p in 1 2; do 73for p in ${SSH_PROTOCOLS}; do
68 trace "simple clear forwarding proto $p" 74 trace "simple clear forwarding proto $p"
69 ${SSH} -$p -F $OBJ/ssh_config -oClearAllForwardings=yes somehost true 75 ${SSH} -$p -F $OBJ/ssh_config -oClearAllForwardings=yes somehost true
70 76
@@ -107,9 +113,9 @@ done
107 113
108echo "LocalForward ${base}01 127.0.0.1:$PORT" >> $OBJ/ssh_config 114echo "LocalForward ${base}01 127.0.0.1:$PORT" >> $OBJ/ssh_config
109echo "RemoteForward ${base}02 127.0.0.1:${base}01" >> $OBJ/ssh_config 115echo "RemoteForward ${base}02 127.0.0.1:${base}01" >> $OBJ/ssh_config
110for p in 1 2; do 116for p in ${SSH_PROTOCOLS}; do
111 trace "config file: start forwarding, fork to background" 117 trace "config file: start forwarding, fork to background"
112 ${SSH} -$p -F $OBJ/ssh_config -f somehost sleep 10 118 ${SSH} -S $CTL -M -$p -F $OBJ/ssh_config -f somehost sleep 10
113 119
114 trace "config file: transfer over forwarded channels and check result" 120 trace "config file: transfer over forwarded channels and check result"
115 ${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \ 121 ${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \
@@ -117,7 +123,7 @@ for p in 1 2; do
117 test -s ${COPY} || fail "failed copy of ${DATA}" 123 test -s ${COPY} || fail "failed copy of ${DATA}"
118 cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" 124 cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}"
119 125
120 wait 126 ${SSH} -S $CTL -O exit somehost
121done 127done
122 128
123for p in 2; do 129for p in 2; do