summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-02-24 17:29:34 +1100
committerDamien Miller <djm@mindrot.org>2010-02-24 17:29:34 +1100
commitc1739211a6ce790e72262db90ba4b1d0ce79d1f4 (patch)
tree733daa52135a8f4abc2ef3c96d5bb7f409626630
parent8f9492c90d02f97cf7248147961b3f2a9de075d8 (diff)
- djm@cvs.openbsd.org 2010/02/24 06:21:56
[regress/test-exec.sh] wait for sshd to fully stop in cleanup() function; avoids races in tests that do multiple start_sshd/cleanup cycles; "I hate pidfiles" deraadt@
-rw-r--r--ChangeLog4
-rw-r--r--regress/test-exec.sh12
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5595fdbb..5c637af1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,10 @@
[regress/Makefile]
turn on all the malloc(3) checking options when running regression
tests. this has caught a few bugs for me in the past; ok dtucker@
+ - djm@cvs.openbsd.org 2010/02/24 06:21:56
+ [regress/test-exec.sh]
+ wait for sshd to fully stop in cleanup() function; avoids races in tests
+ that do multiple start_sshd/cleanup cycles; "I hate pidfiles" deraadt@
20100212
- (djm) OpenBSD CVS Sync
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 804a2969..b3a19389 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: test-exec.sh,v 1.36 2009/10/08 18:04:27 markus Exp $
+# $OpenBSD: test-exec.sh,v 1.37 2010/02/24 06:21:56 djm Exp $
# Placed in the Public Domain.
#SUDO=sudo
@@ -172,9 +172,17 @@ cleanup ()
echo no sshd running
else
if [ $pid -lt 2 ]; then
- echo bad pid for ssd: $pid
+ echo bad pid for ssh: $pid
else
$SUDO kill $pid
+ trace "wait for sshd to exit"
+ i=0;
+ while [ -f $PIDFILE -a $i -lt 5 ]; do
+ i=`expr $i + 1`
+ sleep $i
+ done
+ test -f $PIDFILE && \
+ fatal "sshd didn't exit port $PORT pid $pid"
fi
fi
fi