From 7bad2481c956956ce62eff953ae477333b6c4494 Mon Sep 17 00:00:00 2001 From: rexlee8776 Date: Sat, 25 Nov 2017 06:44:33 +0000 Subject: bugfix: kill process do not accurately kill "nova-api" JIRA: YARDSTICK-849 1. update the kill process RegEx pattern to be more accurate 2. make attack_process to be parameter so it can be customized if the SUT is using a different name of attack_process Change-Id: I569730ced6c24aafbffcf2fc5752d3560d0adac5 Signed-off-by: rexlee8776 (cherry picked from commit 4bbd919e2b26fe606bb1b83efc579e0f2557593e) --- tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml | 5 +++-- tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml | 5 +++-- tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml | 5 +++-- tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml | 5 +++-- tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml | 5 +++-- tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml | 5 +++-- tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml | 5 +++-- tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml | 5 +++-- tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml | 3 ++- tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml | 5 +++-- .../scenarios/availability/ha_tools/fault_process_kill.bash | 2 +- 11 files changed, 30 insertions(+), 20 deletions(-) diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml index d729169a6..08037d9fa 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml @@ -16,6 +16,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "nova-api" %} scenarios: - @@ -23,7 +24,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "nova-api" + process_name: "{{ attack_process }}" host: {{attack_host}} wait_time: 10 @@ -35,7 +36,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "nova-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml index 6a3465cc9..bc7cd3d28 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "neutron-server" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "neutron-server" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "neutron-server" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml index 200bdfc81..3b04cc4bd 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "keystone" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "keystone" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "keystone" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml index d7c69c0d3..d199e5117 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "glance-api" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "glance-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "glance-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml index ddc62bb16..2bca1fb9d 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "cinder-api" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "cinder-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "cinder-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml index b23bb330f..a3df57ce8 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "swift-proxy" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "swift-proxy" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "swift-proxy" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml index bcf5902fa..c2a4f9ede 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "haproxy" %} scenarios: - @@ -25,13 +26,13 @@ scenarios: fault_type: "kill-process" host: {{attack_host}} key: "kill-process" - process_name: "haproxy" + process_name: "{{ attack_process }}" monitors: - monitor_type: "process" key: "service-status" - process_name: "haproxy" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml index 0035a1f07..9194d9d4e 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml @@ -17,6 +17,7 @@ description: > {% set attack_host = attack_host or 'node1' %} {% set monitor_time = monitor_time or 10 %} {% set monitor_number = monitor_number or 3 %} +{% set attack_process = attack_process or "rabbitmq-server" %} scenarios: - @@ -24,7 +25,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "rabbitmq-server" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -57,7 +58,7 @@ scenarios: max_outage_time: 5 - monitor_type: "process" - process_name: "rabbitmq-server" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 sla: diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml index 6d710910a..f6a35e915 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml @@ -20,6 +20,7 @@ description: > {% set check_host = check_host or 'node2' %} {% set monitor_time = monitor_time or 10 %} {% set monitor_number = monitor_number or 3 %} +{% set attack_process = attack_process or "corosync" %} scenarios: - @@ -32,7 +33,7 @@ scenarios: key: "kill-process" attack_key: "kill-corosync" action_parameter: - process_name: "corosync" + process_name: "{{ attack_process }}" monitors: - diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml index 77b9172a9..06d460032 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml @@ -17,6 +17,7 @@ description: > {% set image = image or 'yardstick-image' %} {% set flavor = flavor or 'yardstick-flavor' %} {% set attack_host = attack_host or 'node1' %} +{% set attack_process = attack_process or "neutron-l3-agent" %} scenarios: - @@ -27,12 +28,12 @@ scenarios: fault_type: "kill-process" host: {{attack_host}} key: "kill-process" - process_name: "neutron-l3-agent" + process_name: "{{ attack_process }}" monitors: - monitor_type: "process" - process_name: "neutron-l3-agent" + process_name: "{{ attack_process }}" host: {{attack_host}} key: "monitor-recovery" monitor_time: 30 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 eec86e133..d34ce9338 100755 --- a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash +++ b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash @@ -26,7 +26,7 @@ elif [ "$process_name" = "haproxy" ]; then kill -9 "${pid}" done else - for pid in $(pgrep -f "/usr/.*/${process_name}"); + for pid in $(pgrep -fa [^-_a-zA-Z0-9]${process_name} | grep -iv heartbeat | awk '{print $1}'); do kill -9 "${pid}" done -- cgit 1.2.3-korg