From d466b6a5cfba17a83c7aae9f584ab164e2ece0a1 Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Sat, 20 Jul 2019 09:14:40 +0000 Subject: 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 --- regress/forwarding.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'regress/forwarding.sh') 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 @@ -# $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}" -- cgit v1.2.3 From 0423043c5e54293f4dd56041304fd0046c317be9 Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Sat, 20 Jul 2019 09:37:31 +0000 Subject: upstream: Allow SLEEPTIME to be overridden. OpenBSD-Regress-ID: 1596ab168729954be3d219933b2d01cc93687e76 --- regress/forwarding.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'regress/forwarding.sh') diff --git a/regress/forwarding.sh b/regress/forwarding.sh index d1219a6db..ef4f3b3c4 100644 --- a/regress/forwarding.sh +++ b/regress/forwarding.sh @@ -1,4 +1,4 @@ -# $OpenBSD: forwarding.sh,v 1.21 2019/07/20 09:14:40 dtucker Exp $ +# $OpenBSD: forwarding.sh,v 1.22 2019/07/20 09:37:31 dtucker Exp $ # Placed in the Public Domain. tid="local and remote forwarding" @@ -7,7 +7,7 @@ DATA=/bin/ls${EXEEXT} start_sshd -SLEEPTIME=10 +SLEEPTIME=${SLEEPTIME:-10} base=33 last=$PORT -- cgit v1.2.3 From 41e22c2e05cb950b704945ac9408f6109c9b7848 Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Sat, 20 Jul 2019 09:50:58 +0000 Subject: upstream: Remove the sleeps and thus races from the forwarding test. They were originally required to work with Protocol 1, but now we can use ssh -N and the control socket without the sleeps. While there, suppress output fro the control exit commands. OpenBSD-Regress-ID: 4c51a1d651242f12c90074c18c61008a74c1c790 --- regress/forwarding.sh | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'regress/forwarding.sh') diff --git a/regress/forwarding.sh b/regress/forwarding.sh index ef4f3b3c4..cd634f2f6 100644 --- a/regress/forwarding.sh +++ b/regress/forwarding.sh @@ -1,4 +1,4 @@ -# $OpenBSD: forwarding.sh,v 1.22 2019/07/20 09:37:31 dtucker Exp $ +# $OpenBSD: forwarding.sh,v 1.23 2019/07/20 09:50:58 dtucker Exp $ # Placed in the Public Domain. tid="local and remote forwarding" @@ -7,8 +7,6 @@ DATA=/bin/ls${EXEEXT} start_sshd -SLEEPTIME=${SLEEPTIME:-10} - base=33 last=$PORT fwd="" @@ -28,7 +26,7 @@ done trace "start forwarding, fork to background" rm -f $CTL -${SSH} -S $CTL -M -F $OBJ/ssh_config -f $fwd somehost sleep ${SLEEPTIME} +${SSH} -S $CTL -N -M -F $OBJ/ssh_config -f $fwd somehost trace "transfer over forwarded channels and check result" ${SSH} -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ @@ -36,7 +34,7 @@ ${SSH} -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ test -s ${COPY} || fail "failed copy of ${DATA}" cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" -${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost +${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null for d in L R; do trace "exit on -$d forward failure" @@ -71,8 +69,8 @@ ${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 ${SLEEPTIME} +${SSH} -S $CTL -N -M -f -F $OBJ/ssh_config -L ${base}01:127.0.0.1:$PORT \ + -oClearAllForwardings=yes somehost if [ $? != 0 ]; then fail "connection failed with cleared local forwarding" else @@ -81,12 +79,12 @@ else >>$TEST_REGRESS_LOGFILE 2>&1 && \ fail "local forwarding not cleared" fi -${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost +${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null 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 ${SLEEPTIME} +${SSH} -S $CTL -N -M -f -F $OBJ/ssh_config -R ${base}01:127.0.0.1:$PORT \ + -oClearAllForwardings=yes somehost if [ $? != 0 ]; then fail "connection failed with cleared remote forwarding" else @@ -95,7 +93,7 @@ else >>$TEST_REGRESS_LOGFILE 2>&1 && \ fail "remote forwarding not cleared" fi -${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost +${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null trace "stdio forwarding" cmd="${SSH} -F $OBJ/ssh_config" @@ -109,7 +107,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 ${SLEEPTIME} +${SSH} -S $CTL -N -M -F $OBJ/ssh_config -f somehost trace "config file: transfer over forwarded channels and check result" ${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \ @@ -117,22 +115,22 @@ ${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \ test -s ${COPY} || fail "failed copy of ${DATA}" cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" -${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost +${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null 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 ${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} -S $CTL -N -M -f -F $OBJ/ssh_config -R${base}01:[$OBJ/unix-1.fwd] somehost +${SSH} -S $CTL.1 -N -M -f -F $OBJ/ssh_config -L[$OBJ/unix-1.fwd]:[$OBJ/unix-2.fwd] somehost +${SSH} -S $CTL.2 -N -M -f -F $OBJ/ssh_config -R[$OBJ/unix-2.fwd]:[$OBJ/unix-3.fwd] somehost +${SSH} -S $CTL.3 -N -M -f -F $OBJ/ssh_config -L[$OBJ/unix-3.fwd]:127.0.0.1:$PORT somehost ${SSH} -F $OBJ/ssh_config -p${base}01 -o 'ConnectionAttempts=4' \ somehost cat ${DATA} > ${COPY} test -s ${COPY} || fail "failed copy ${DATA}" cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" -${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost -${SSH} -F $OBJ/ssh_config -S $CTL.1 -O exit somehost -${SSH} -F $OBJ/ssh_config -S $CTL.2 -O exit somehost -${SSH} -F $OBJ/ssh_config -S $CTL.3 -O exit somehost +${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null +${SSH} -F $OBJ/ssh_config -S $CTL.1 -O exit somehost 2>/dev/null +${SSH} -F $OBJ/ssh_config -S $CTL.2 -O exit somehost 2>/dev/null +${SSH} -F $OBJ/ssh_config -S $CTL.3 -O exit somehost 2>/dev/null -- cgit v1.2.3