summaryrefslogtreecommitdiff
path: root/regress/test-exec.sh
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-07-09 13:22:03 +1000
committerDamien Miller <djm@mindrot.org>2014-07-09 13:22:03 +1000
commit612f965239a30fe536b11ece1834d9f470aeb029 (patch)
tree6c05fe13a46c0b356d76f12af5c2f360208585f1 /regress/test-exec.sh
parentd0bb950485ba121e43a77caf434115ed6417b46f (diff)
- djm@cvs.openbsd.org 2014/07/06 07:42:03
[multiplex.sh test-exec.sh] add a hook to the cleanup() function to kill $SSH_PID if it is set use it to kill the mux master started in multiplex.sh (it was being left around on fatal failures)
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r--regress/test-exec.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index aac8aa5c2..a1bab832f 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.47 2013/11/09 05:41:34 dtucker Exp $ 1# $OpenBSD: test-exec.sh,v 1.48 2014/07/06 07:42:03 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4#SUDO=sudo 4#SUDO=sudo
@@ -240,13 +240,20 @@ md5 () {
240# helper 240# helper
241cleanup () 241cleanup ()
242{ 242{
243 if [ "x$SSH_PID" != "x" ]; then
244 if [ $SSH_PID -lt 2 ]; then
245 echo bad pid for ssh: $SSH_PID
246 else
247 kill $SSH_PID
248 fi
249 fi
243 if [ -f $PIDFILE ]; then 250 if [ -f $PIDFILE ]; then
244 pid=`$SUDO cat $PIDFILE` 251 pid=`$SUDO cat $PIDFILE`
245 if [ "X$pid" = "X" ]; then 252 if [ "X$pid" = "X" ]; then
246 echo no sshd running 253 echo no sshd running
247 else 254 else
248 if [ $pid -lt 2 ]; then 255 if [ $pid -lt 2 ]; then
249 echo bad pid for ssh: $pid 256 echo bad pid for sshd: $pid
250 else 257 else
251 $SUDO kill $pid 258 $SUDO kill $pid
252 trace "wait for sshd to exit" 259 trace "wait for sshd to exit"