summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2011-06-03 14:19:02 +1000
committerDarren Tucker <dtucker@zip.com.au>2011-06-03 14:19:02 +1000
commitbf4d05a37ca67a2b2c69ef072652b6be3b24fd76 (patch)
treed8ad0a93de87443525a4bf60923fc7646bcaaa45
parent75e035c34e323cccb19aab5d58cb9c706ce8fcee (diff)
- dtucker@cvs.openbsd.org 2011/06/03 00:29:52
[regress/dynamic-forward.sh] Retry establishing the port forwarding after a small delay, should make the tests less flaky when the previous test is slow to shut down and free up the port.
-rw-r--r--ChangeLog5
-rw-r--r--regress/dynamic-forward.sh22
2 files changed, 22 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index af92ed3f..c4ced5da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,11 @@
- dtucker@cvs.openbsd.org 2011/05/31 02:03:34
[regress/dynamic-forward.sh]
work around startup and teardown races; caught by deraadt
+ - dtucker@cvs.openbsd.org 2011/06/03 00:29:52
+ [regress/dynamic-forward.sh]
+ Retry establishing the port forwarding after a small delay, should make
+ the tests less flaky when the previous test is slow to shut down and free
+ up the port.
20110529
- (djm) OpenBSD CVS Sync
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh
index 39b58c81..d1ab8059 100644
--- a/regress/dynamic-forward.sh
+++ b/regress/dynamic-forward.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: dynamic-forward.sh,v 1.8 2011/05/31 02:03:34 dtucker Exp $
+# $OpenBSD: dynamic-forward.sh,v 1.9 2011/06/03 00:29:52 dtucker Exp $
# Placed in the Public Domain.
tid="dynamic forwarding"
@@ -20,10 +20,23 @@ trace "will use ProxyCommand $proxycmd"
start_sshd
for p in 1 2; do
+ n=0
+ error="1"
trace "start dynamic forwarding, fork to background"
- ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT -q \
- -oExitOnForwardFailure=yes somehost \
- exec sh -c \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\'
+ while [ "$error" -ne 0 -a "$n" -lt 3 ]; do
+ n=`expr $n + 1`
+ ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT -q \
+ -oExitOnForwardFailure=yes somehost exec sh -c \
+ \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\'
+ error=$?
+ if [ "$error" -ne 0 ]; then
+ trace "forward failed proto $p attempt $n err $error"
+ sleep $n
+ fi
+ done
+ if [ "$error" -ne 0 ]; then
+ fatal "failed to start dynamic forwarding proto $p"
+ fi
for s in 4 5; do
for h in 127.0.0.1 localhost; do
@@ -42,7 +55,6 @@ for p in 1 2; do
if [ $remote -gt 1 ]; then
kill -HUP $remote
fi
- sleep 1
else
fail "no pid file: $OBJ/remote_pid"
fi