summaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
diff options
context:
space:
mode:
authorJingLu5 <lvjing5@huawei.com>2017-06-21 10:07:41 +0000
committerJingLu5 <lvjing5@huawei.com>2017-06-22 12:45:17 +0000
commit5b99f1532ec4d15258ec86e970acd2904954b3bc (patch)
tree2a60b1598523f6707f53823b7e0c9fab3674127e /yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
parent8b8738ed675f8aab93d484df300e3d0c6c24becc (diff)
HA testcase improvement
This patch improve HA test case in the following aspects: 1. the "GeneralHA" type now will check if the target service process in the controller node. 2. support ignore server certificate 3. add debug log for recovering service failed 4. improve method to kill keystone process Change-Id: I9ae7ab54391fe41d5d7f3e4951a7ac2e3ba75968 Signed-off-by: JingLu5 <lvjing5@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash')
-rwxr-xr-xyardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash9
1 files changed, 6 insertions, 3 deletions
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
index a6a3e96ca..a865b6551 100755
--- a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
@@ -16,10 +16,13 @@ set -e
process_name=$1
if [ "$process_name" = "keystone" ]; then
- killall -9 -u $process_name
+ for pid in $(ps aux | grep "keystone" | grep -iv heartbeat | grep -iv monitor | grep -v grep | grep -v /bin/sh | awk '{print $2}'); \
+ do
+ kill -9 "${pid}"
+ done
else
- for pid in `ps aux | grep "/usr/.*/${process_name}" | grep -v grep | grep -v /bin/sh | awk '{print $2}'`; \
+ for pid in $(pgrep -f "/usr/.*/${process_name}");
do
- kill -9 ${pid}
+ kill -9 "${pid}"
done
fi