diff options
Diffstat (limited to 'regress/dynamic-forward.sh')
-rw-r--r-- | regress/dynamic-forward.sh | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh index 39b58c817..d1ab8059b 100644 --- a/regress/dynamic-forward.sh +++ b/regress/dynamic-forward.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: dynamic-forward.sh,v 1.8 2011/05/31 02:03:34 dtucker Exp $ | 1 | # $OpenBSD: dynamic-forward.sh,v 1.9 2011/06/03 00:29:52 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="dynamic forwarding" | 4 | tid="dynamic forwarding" |
@@ -20,10 +20,23 @@ trace "will use ProxyCommand $proxycmd" | |||
20 | start_sshd | 20 | start_sshd |
21 | 21 | ||
22 | for p in 1 2; do | 22 | for p in 1 2; do |
23 | n=0 | ||
24 | error="1" | ||
23 | trace "start dynamic forwarding, fork to background" | 25 | trace "start dynamic forwarding, fork to background" |
24 | ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT -q \ | 26 | while [ "$error" -ne 0 -a "$n" -lt 3 ]; do |
25 | -oExitOnForwardFailure=yes somehost \ | 27 | n=`expr $n + 1` |
26 | exec sh -c \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\' | 28 | ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT -q \ |
29 | -oExitOnForwardFailure=yes somehost exec sh -c \ | ||
30 | \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\' | ||
31 | error=$? | ||
32 | if [ "$error" -ne 0 ]; then | ||
33 | trace "forward failed proto $p attempt $n err $error" | ||
34 | sleep $n | ||
35 | fi | ||
36 | done | ||
37 | if [ "$error" -ne 0 ]; then | ||
38 | fatal "failed to start dynamic forwarding proto $p" | ||
39 | fi | ||
27 | 40 | ||
28 | for s in 4 5; do | 41 | for s in 4 5; do |
29 | for h in 127.0.0.1 localhost; do | 42 | for h in 127.0.0.1 localhost; do |
@@ -42,7 +55,6 @@ for p in 1 2; do | |||
42 | if [ $remote -gt 1 ]; then | 55 | if [ $remote -gt 1 ]; then |
43 | kill -HUP $remote | 56 | kill -HUP $remote |
44 | fi | 57 | fi |
45 | sleep 1 | ||
46 | else | 58 | else |
47 | fail "no pid file: $OBJ/remote_pid" | 59 | fail "no pid file: $OBJ/remote_pid" |
48 | fi | 60 | fi |