summaryrefslogtreecommitdiff
path: root/regress/forwarding.sh
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2019-07-20 09:14:40 +0000
committerDarren Tucker <dtucker@dtucker.net>2019-07-20 22:11:00 +1000
commitd466b6a5cfba17a83c7aae9f584ab164e2ece0a1 (patch)
tree2082015dd16ad1ffcab47932270bb7ff7002f1e6 /regress/forwarding.sh
parentb4a7c9d2b5f928e0b902b580d35dc8b244a3aae0 (diff)
downloadopenssh-git-d466b6a5cfba17a83c7aae9f584ab164e2ece0a1.tar.gz
upstream: Move sleep time into a variable so that we can increase
it for platforms or configurations that are much slower then usual. OpenBSD-Regress-ID: 88586cabc800062c260d0b876bdcd4ca3f58a872
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 7d0fae11..d1219a6d 100644
--- a/regress/forwarding.sh
+++ b/regress/forwarding.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: forwarding.sh,v 1.20 2017/04/30 23:34:55 djm Exp $
+# $OpenBSD: forwarding.sh,v 1.21 2019/07/20 09:14:40 dtucker Exp $
# Placed in the Public Domain.
tid="local and remote forwarding"
@@ -7,6 +7,8 @@ DATA=/bin/ls${EXEEXT}
start_sshd
+SLEEPTIME=10
+
base=33
last=$PORT
fwd=""
@@ -26,7 +28,7 @@ done
trace "start forwarding, fork to background"
rm -f $CTL
-${SSH} -S $CTL -M -F $OBJ/ssh_config -f $fwd somehost sleep 10
+${SSH} -S $CTL -M -F $OBJ/ssh_config -f $fwd somehost sleep ${SLEEPTIME}
trace "transfer over forwarded channels and check result"
${SSH} -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \
@@ -70,7 +72,7 @@ ${SSH} -F $OBJ/ssh_config -oClearAllForwardings=yes somehost true
trace "clear local forward"
rm -f $CTL
${SSH} -S $CTL -M -f -F $OBJ/ssh_config -L ${base}01:127.0.0.1:$PORT \
- -oClearAllForwardings=yes somehost sleep 10
+ -oClearAllForwardings=yes somehost sleep ${SLEEPTIME}
if [ $? != 0 ]; then
fail "connection failed with cleared local forwarding"
else
@@ -84,7 +86,7 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost
trace "clear remote forward"
rm -f $CTL
${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R ${base}01:127.0.0.1:$PORT \
- -oClearAllForwardings=yes somehost sleep 10
+ -oClearAllForwardings=yes somehost sleep ${SLEEPTIME}
if [ $? != 0 ]; then
fail "connection failed with cleared remote forwarding"
else
@@ -107,7 +109,7 @@ echo "RemoteForward ${base}02 127.0.0.1:${base}01" >> $OBJ/ssh_config
trace "config file: start forwarding, fork to background"
rm -f $CTL
-${SSH} -S $CTL -M -F $OBJ/ssh_config -f somehost sleep 10
+${SSH} -S $CTL -M -F $OBJ/ssh_config -f somehost sleep ${SLEEPTIME}
trace "config file: transfer over forwarded channels and check result"
${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
trace "transfer over chained unix domain socket forwards and check result"
rm -f $OBJ/unix-[123].fwd
rm -f $CTL $CTL.[123]
-${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R${base}01:[$OBJ/unix-1.fwd] somehost sleep 10
-${SSH} -S $CTL.1 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-1.fwd]:[$OBJ/unix-2.fwd] somehost sleep 10
-${SSH} -S $CTL.2 -M -f -F $OBJ/ssh_config -R[$OBJ/unix-2.fwd]:[$OBJ/unix-3.fwd] somehost sleep 10
-${SSH} -S $CTL.3 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-3.fwd]:127.0.0.1:$PORT somehost sleep 10
+${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R${base}01:[$OBJ/unix-1.fwd] somehost sleep ${SLEEPTIME}
+${SSH} -S $CTL.1 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-1.fwd]:[$OBJ/unix-2.fwd] somehost sleep ${SLEEPTIME}
+${SSH} -S $CTL.2 -M -f -F $OBJ/ssh_config -R[$OBJ/unix-2.fwd]:[$OBJ/unix-3.fwd] somehost sleep ${SLEEPTIME}
+${SSH} -S $CTL.3 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-3.fwd]:127.0.0.1:$PORT somehost sleep ${SLEEPTIME}
${SSH} -F $OBJ/ssh_config -p${base}01 -o 'ConnectionAttempts=4' \
somehost cat ${DATA} > ${COPY}
test -s ${COPY} || fail "failed copy ${DATA}"