Terminate openstack service process using kill command in HA test cases 03/35303/2
authorJingLu5 <lvjing5@huawei.com>
Thu, 25 May 2017 03:58:52 +0000 (03:58 +0000)
committerJingLu5 <lvjing5@huawei.com>
Thu, 25 May 2017 04:01:57 +0000 (04:01 +0000)
JIRA: YARDSTICK-659

In some openstack environment, the service process cannot be killed by killall
command but can be terminate by kill command.
This patch is about to switch to use kill command in the
fault_process_kill.bash to kill processes.

Change-Id: Iec455ee56d3f31fb5c16de5994870d1acd33f41a
Signed-off-by: JingLu5 <lvjing5@huawei.com>
yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash

index e0491b0..a6a3e96 100755 (executable)
@@ -16,7 +16,10 @@ set -e
 process_name=$1
 
 if [ "$process_name" = "keystone" ]; then
-    killall -9 -u $process_name 
+    killall -9 -u $process_name
 else
-    killall -9 $process_name
+    for pid in `ps aux | grep "/usr/.*/${process_name}" | grep -v grep | grep -v /bin/sh | awk '{print $2}'`; \
+        do
+            kill -9 ${pid}
+        done
 fi