Terminate openstack service process using kill command in HA test cases 15/36215/1
authorJingLu5 <lvjing5@huawei.com>
Thu, 25 May 2017 03:58:52 +0000 (03:58 +0000)
committerJing Lu <lvjing5@huawei.com>
Tue, 20 Jun 2017 04:06:12 +0000 (04:06 +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>
(cherry picked from commit dd42ba3cafb908246da5b90c8bbbc2c7d0beb801)

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