[sheepdog] [PATCH v2 11/21] tests/functional: support start/kill sheep with number bigger than 9

Liu Yuan namei.unix at gmail.com
Wed Oct 16 07:50:37 CEST 2013


Current script can't distinguish, e.g, 1 and 10.

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 tests/functional/common.rc |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/functional/common.rc b/tests/functional/common.rc
index 2a64b53..f9f4ef7 100644
--- a/tests/functional/common.rc
+++ b/tests/functional/common.rc
@@ -177,7 +177,7 @@ _wait_for_sheep_stop()
 	if [ "$1" == "" ]; then
 	    pgrep -f "$SHEEP_PROG $WD" > /dev/null
 	else
-	    pgrep -f "$SHEEP_PROG $STORE/$1" > /dev/null
+	    pgrep -f "$SHEEP_PROG $STORE/$1 " > /dev/null
 	fi
 	if [ $? == 0 ]; then
 	    sleep 1
@@ -288,7 +288,7 @@ _start_sheep()
     local running=true
     local cnt
     for cnt in `seq 1 10`; do  # wait at most 10 seconds
-        pgrep -f "$SHEEP_PROG $STORE/$1" > /dev/null
+        pgrep -f "$SHEEP_PROG $STORE/$1 " > /dev/null
         if [ $? != 0 ]; then
             running=false
             break
@@ -329,7 +329,7 @@ _kill_all_sheeps()
 
 _kill_sheep()
 {
-    pkill -9 -f "$SHEEP_PROG $STORE/$1"
+    pkill -9 -f "$SHEEP_PROG $STORE/$1 "
 
     if [ $? != 0 ]; then
         _die "cannot kill sheep $1"
-- 
1.7.9.5




More information about the sheepdog mailing list