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, 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
4tid="local and remote forwarding" 4tid="local and remote forwarding"
@@ -7,6 +7,8 @@ DATA=/bin/ls${EXEEXT}
7 7
8start_sshd 8start_sshd
9 9
10SLEEPTIME=10
11
10base=33 12base=33
11last=$PORT 13last=$PORT
12fwd="" 14fwd=""
@@ -26,7 +28,7 @@ done
26 28
27trace "start forwarding, fork to background" 29trace "start forwarding, fork to background"
28rm -f $CTL 30rm -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
31trace "transfer over forwarded channels and check result" 33trace "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
70trace "clear local forward" 72trace "clear local forward"
71rm -f $CTL 73rm -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}
74if [ $? != 0 ]; then 76if [ $? != 0 ]; then
75 fail "connection failed with cleared local forwarding" 77 fail "connection failed with cleared local forwarding"
76else 78else
@@ -84,7 +86,7 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost
84trace "clear remote forward" 86trace "clear remote forward"
85rm -f $CTL 87rm -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}
88if [ $? != 0 ]; then 90if [ $? != 0 ]; then
89 fail "connection failed with cleared remote forwarding" 91 fail "connection failed with cleared remote forwarding"
90else 92else
@@ -107,7 +109,7 @@ echo "RemoteForward ${base}02 127.0.0.1:${base}01" >> $OBJ/ssh_config
107 109
108trace "config file: start forwarding, fork to background" 110trace "config file: start forwarding, fork to background"
109rm -f $CTL 111rm -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
112trace "config file: transfer over forwarded channels and check result" 114trace "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
120trace "transfer over chained unix domain socket forwards and check result" 122trace "transfer over chained unix domain socket forwards and check result"
121rm -f $OBJ/unix-[123].fwd 123rm -f $OBJ/unix-[123].fwd
122rm -f $CTL $CTL.[123] 124rm -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}
129test -s ${COPY} || fail "failed copy ${DATA}" 131test -s ${COPY} || fail "failed copy ${DATA}"