- dtucker@cvs.openbsd.org 2011/05/20 05:19:50
[dynamic-forward.sh] Prevent races in dynamic forwarding test; ok djm
This commit is contained in:
parent
3045b45a03
commit
7b9451f382
|
@ -38,6 +38,9 @@
|
||||||
[cert-hostkey.sh]
|
[cert-hostkey.sh]
|
||||||
another attempt to generate a v00 ECDSA key that broke the test
|
another attempt to generate a v00 ECDSA key that broke the test
|
||||||
ID sync only - portable already had this somehow
|
ID sync only - portable already had this somehow
|
||||||
|
- dtucker@cvs.openbsd.org 2011/05/20 05:19:50
|
||||||
|
[dynamic-forward.sh]
|
||||||
|
Prevent races in dynamic forwarding test; ok djm
|
||||||
|
|
||||||
20110515
|
20110515
|
||||||
- (djm) OpenBSD CVS Sync
|
- (djm) OpenBSD CVS Sync
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $OpenBSD: dynamic-forward.sh,v 1.4 2004/06/22 22:55:56 dtucker Exp $
|
# $OpenBSD: dynamic-forward.sh,v 1.5 2011/05/20 05:19:50 dtucker Exp $
|
||||||
# Placed in the Public Domain.
|
# Placed in the Public Domain.
|
||||||
|
|
||||||
tid="dynamic forwarding"
|
tid="dynamic forwarding"
|
||||||
|
@ -21,8 +21,21 @@ start_sshd
|
||||||
|
|
||||||
for p in 1 2; do
|
for p in 1 2; do
|
||||||
trace "start dynamic forwarding, fork to background"
|
trace "start dynamic forwarding, fork to background"
|
||||||
${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT -q somehost \
|
rm -f $OBJ/remote_pid
|
||||||
exec sh -c \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\'
|
${SSH} -$p -F $OBJ/ssh_config -D $FWDPORT -q somehost \
|
||||||
|
exec sh -c \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\' &
|
||||||
|
client_pid=$!
|
||||||
|
|
||||||
|
# Wait for ssh to start
|
||||||
|
n=0
|
||||||
|
while test ! -f $OBJ/remote_pid; do
|
||||||
|
sleep 1
|
||||||
|
n=`expr $n + 1`
|
||||||
|
if test $n > 60; then
|
||||||
|
kill $client_pid
|
||||||
|
fail "Timed out waiting for client to connect"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
for s in 4 5; do
|
for s in 4 5; do
|
||||||
for h in 127.0.0.1 localhost; do
|
for h in 127.0.0.1 localhost; do
|
||||||
|
@ -41,10 +54,14 @@ for p in 1 2; do
|
||||||
if [ $remote -gt 1 ]; then
|
if [ $remote -gt 1 ]; then
|
||||||
kill -HUP $remote
|
kill -HUP $remote
|
||||||
fi
|
fi
|
||||||
|
rm -f $OBJ/remote_pid
|
||||||
else
|
else
|
||||||
fail "no pid file: $OBJ/remote_pid"
|
fail "no pid file: $OBJ/remote_pid"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Wait for listening ssh to terminate
|
||||||
|
wait
|
||||||
|
|
||||||
# Must allow time for connection tear-down
|
# Must allow time for connection tear-down
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue