[sheepdog] [PATCH 3/3] tests/functional: check process in _wait_for_sheep_stop()

MORITA Kazutaka morita.kazutaka at gmail.com
Thu Jun 27 07:11:32 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

The sheep process can exist for a moment after it receives a kill
signal.  We have to wait until the process is surely killed.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/functional/common.rc |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/functional/common.rc b/tests/functional/common.rc
index 036c193..f621261 100644
--- a/tests/functional/common.rc
+++ b/tests/functional/common.rc
@@ -170,6 +170,17 @@ _wait_for_sheep_stop()
 {
     local cnt
     for cnt in `seq 60`; do # wait at most 60 seconds
+	# check sheep process
+	if [ "$1" == "" ]; then
+	    pgrep -f "$SHEEP_PROG $WD" > /dev/null
+	else
+	    pgrep -f "$SHEEP_PROG $STORE/$1" > /dev/null
+	fi
+	if [ $? == 0 ]; then
+	    sleep 1
+	    continue
+	fi
+
 	# make sure that the sheep port is available
 	if [ "$1" == "" ]; then
 	    netstat -an | grep tcp | grep :70[0-9][0-9] | \
-- 
1.7.9.5




More information about the sheepdog mailing list