diff options
Diffstat (limited to 'regress/forwarding.sh')
-rw-r--r-- | regress/forwarding.sh | 20 |
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 | ||
4 | tid="local and remote forwarding" | 4 | tid="local and remote forwarding" |
@@ -10,6 +10,9 @@ start_sshd | |||
10 | base=33 | 10 | base=33 |
11 | last=$PORT | 11 | last=$PORT |
12 | fwd="" | 12 | fwd="" |
13 | CTL=$OBJ/ctl-sock | ||
14 | rm -f $CTL | ||
15 | |||
13 | for j in 0 1 2; do | 16 | for 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 |
22 | done | 25 | done |
23 | for p in 1 2; do | 26 | for 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 |
35 | done | 41 | done |
36 | 42 | ||
37 | for p in 1 2; do | 43 | for p in ${SSH_PROTOCOLS}; do |
38 | for d in L R; do | 44 | for 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 | |||
64 | done | 70 | done |
65 | done | 71 | done |
66 | 72 | ||
67 | for p in 1 2; do | 73 | for 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 | ||
108 | echo "LocalForward ${base}01 127.0.0.1:$PORT" >> $OBJ/ssh_config | 114 | echo "LocalForward ${base}01 127.0.0.1:$PORT" >> $OBJ/ssh_config |
109 | echo "RemoteForward ${base}02 127.0.0.1:${base}01" >> $OBJ/ssh_config | 115 | echo "RemoteForward ${base}02 127.0.0.1:${base}01" >> $OBJ/ssh_config |
110 | for p in 1 2; do | 116 | for 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 |
121 | done | 127 | done |
122 | 128 | ||
123 | for p in 2; do | 129 | for p in 2; do |