diff options
-rw-r--r-- | regress/forwarding.sh | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/regress/forwarding.sh b/regress/forwarding.sh index 7d0fae114..d1219a6db 100644 --- a/regress/forwarding.sh +++ b/regress/forwarding.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: forwarding.sh,v 1.20 2017/04/30 23:34:55 djm Exp $ | 1 | # $OpenBSD: forwarding.sh,v 1.21 2019/07/20 09:14:40 dtucker 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" |
@@ -7,6 +7,8 @@ DATA=/bin/ls${EXEEXT} | |||
7 | 7 | ||
8 | start_sshd | 8 | start_sshd |
9 | 9 | ||
10 | SLEEPTIME=10 | ||
11 | |||
10 | base=33 | 12 | base=33 |
11 | last=$PORT | 13 | last=$PORT |
12 | fwd="" | 14 | fwd="" |
@@ -26,7 +28,7 @@ done | |||
26 | 28 | ||
27 | trace "start forwarding, fork to background" | 29 | trace "start forwarding, fork to background" |
28 | rm -f $CTL | 30 | rm -f $CTL |
29 | ${SSH} -S $CTL -M -F $OBJ/ssh_config -f $fwd somehost sleep 10 | 31 | ${SSH} -S $CTL -M -F $OBJ/ssh_config -f $fwd somehost sleep ${SLEEPTIME} |
30 | 32 | ||
31 | trace "transfer over forwarded channels and check result" | 33 | trace "transfer over forwarded channels and check result" |
32 | ${SSH} -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ | 34 | ${SSH} -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ |
@@ -70,7 +72,7 @@ ${SSH} -F $OBJ/ssh_config -oClearAllForwardings=yes somehost true | |||
70 | trace "clear local forward" | 72 | trace "clear local forward" |
71 | rm -f $CTL | 73 | rm -f $CTL |
72 | ${SSH} -S $CTL -M -f -F $OBJ/ssh_config -L ${base}01:127.0.0.1:$PORT \ | 74 | ${SSH} -S $CTL -M -f -F $OBJ/ssh_config -L ${base}01:127.0.0.1:$PORT \ |
73 | -oClearAllForwardings=yes somehost sleep 10 | 75 | -oClearAllForwardings=yes somehost sleep ${SLEEPTIME} |
74 | if [ $? != 0 ]; then | 76 | if [ $? != 0 ]; then |
75 | fail "connection failed with cleared local forwarding" | 77 | fail "connection failed with cleared local forwarding" |
76 | else | 78 | else |
@@ -84,7 +86,7 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost | |||
84 | trace "clear remote forward" | 86 | trace "clear remote forward" |
85 | rm -f $CTL | 87 | rm -f $CTL |
86 | ${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R ${base}01:127.0.0.1:$PORT \ | 88 | ${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R ${base}01:127.0.0.1:$PORT \ |
87 | -oClearAllForwardings=yes somehost sleep 10 | 89 | -oClearAllForwardings=yes somehost sleep ${SLEEPTIME} |
88 | if [ $? != 0 ]; then | 90 | if [ $? != 0 ]; then |
89 | fail "connection failed with cleared remote forwarding" | 91 | fail "connection failed with cleared remote forwarding" |
90 | else | 92 | else |
@@ -107,7 +109,7 @@ echo "RemoteForward ${base}02 127.0.0.1:${base}01" >> $OBJ/ssh_config | |||
107 | 109 | ||
108 | trace "config file: start forwarding, fork to background" | 110 | trace "config file: start forwarding, fork to background" |
109 | rm -f $CTL | 111 | rm -f $CTL |
110 | ${SSH} -S $CTL -M -F $OBJ/ssh_config -f somehost sleep 10 | 112 | ${SSH} -S $CTL -M -F $OBJ/ssh_config -f somehost sleep ${SLEEPTIME} |
111 | 113 | ||
112 | trace "config file: transfer over forwarded channels and check result" | 114 | trace "config file: transfer over forwarded channels and check result" |
113 | ${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \ | 115 | ${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \ |
@@ -120,10 +122,10 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost | |||
120 | trace "transfer over chained unix domain socket forwards and check result" | 122 | trace "transfer over chained unix domain socket forwards and check result" |
121 | rm -f $OBJ/unix-[123].fwd | 123 | rm -f $OBJ/unix-[123].fwd |
122 | rm -f $CTL $CTL.[123] | 124 | rm -f $CTL $CTL.[123] |
123 | ${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R${base}01:[$OBJ/unix-1.fwd] somehost sleep 10 | 125 | ${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R${base}01:[$OBJ/unix-1.fwd] somehost sleep ${SLEEPTIME} |
124 | ${SSH} -S $CTL.1 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-1.fwd]:[$OBJ/unix-2.fwd] somehost sleep 10 | 126 | ${SSH} -S $CTL.1 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-1.fwd]:[$OBJ/unix-2.fwd] somehost sleep ${SLEEPTIME} |
125 | ${SSH} -S $CTL.2 -M -f -F $OBJ/ssh_config -R[$OBJ/unix-2.fwd]:[$OBJ/unix-3.fwd] somehost sleep 10 | 127 | ${SSH} -S $CTL.2 -M -f -F $OBJ/ssh_config -R[$OBJ/unix-2.fwd]:[$OBJ/unix-3.fwd] somehost sleep ${SLEEPTIME} |
126 | ${SSH} -S $CTL.3 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-3.fwd]:127.0.0.1:$PORT somehost sleep 10 | 128 | ${SSH} -S $CTL.3 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-3.fwd]:127.0.0.1:$PORT somehost sleep ${SLEEPTIME} |
127 | ${SSH} -F $OBJ/ssh_config -p${base}01 -o 'ConnectionAttempts=4' \ | 129 | ${SSH} -F $OBJ/ssh_config -p${base}01 -o 'ConnectionAttempts=4' \ |
128 | somehost cat ${DATA} > ${COPY} | 130 | somehost cat ${DATA} > ${COPY} |
129 | test -s ${COPY} || fail "failed copy ${DATA}" | 131 | test -s ${COPY} || fail "failed copy ${DATA}" |