aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/availability
diff options
context:
space:
mode:
authortjuyinkanglin <14_ykl@tongji.edu.cn>2017-08-09 23:06:56 +0800
committertjuyinkanglin <14_ykl@tongji.edu.cn>2017-08-23 12:35:28 +0800
commitf71c4a0694365b846146f2957c26c4f071413ace (patch)
tree5fb540a2b15da11f82c14f4a901e5c7fbd0219b9 /yardstick/benchmark/scenarios/availability
parentb39fe5457e846e734e980666bc209fb7c07a6bdc (diff)
Add test case file, document and related scripts of yardstick
tc057(HA_TC014) JIRA: YARDSTICK-779 Change-Id: I6a812b1c88229b20a0dd0ce5bc135c9ba15266db Signed-off-by: tjuyinkanglin <14_ykl@tongji.edu.cn>
Diffstat (limited to 'yardstick/benchmark/scenarios/availability')
-rw-r--r--yardstick/benchmark/scenarios/availability/attacker_conf.yaml4
-rw-r--r--yardstick/benchmark/scenarios/availability/ha_tools/node/reboot_node.bash14
-rw-r--r--yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_resource_status.bash14
-rw-r--r--yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_resource_status_host.bash15
-rw-r--r--yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_vip_host.bash15
-rw-r--r--yardstick/benchmark/scenarios/availability/operation_conf.yaml5
-rw-r--r--yardstick/benchmark/scenarios/availability/result_checker_conf.yaml4
-rw-r--r--yardstick/benchmark/scenarios/availability/util.py2
8 files changed, 72 insertions, 1 deletions
diff --git a/yardstick/benchmark/scenarios/availability/attacker_conf.yaml b/yardstick/benchmark/scenarios/availability/attacker_conf.yaml
index aa144ab50..ee7ea7d83 100644
--- a/yardstick/benchmark/scenarios/availability/attacker_conf.yaml
+++ b/yardstick/benchmark/scenarios/availability/attacker_conf.yaml
@@ -40,3 +40,7 @@ stress-cpu:
block-io:
inject_script: ha_tools/disk/block_io.bash
recovery_script: ha_tools/disk/recovery_disk_io.bash
+
+kill-corosync:
+ inject_script: ha_tools/fault_process_kill.bash
+ recovery_script: ha_tools/node/reboot_node.bash \ No newline at end of file
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/node/reboot_node.bash b/yardstick/benchmark/scenarios/availability/ha_tools/node/reboot_node.bash
new file mode 100644
index 000000000..1ee8c9c2f
--- /dev/null
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/node/reboot_node.bash
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+##############################################################################
+# (c) OPNFV, Yin Kanglin and others.
+# 14_ykl@tongji.edu.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# reboot node
+
+reboot \ No newline at end of file
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_resource_status.bash b/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_resource_status.bash
new file mode 100644
index 000000000..68707cf4f
--- /dev/null
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_resource_status.bash
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+##############################################################################
+# (c) OPNFV, Yin Kanglin and others.
+# 14_ykl@tongji.edu.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# get pacemaker resource status
+
+pcs resource show \ No newline at end of file
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_resource_status_host.bash b/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_resource_status_host.bash
new file mode 100644
index 000000000..7a02ccf29
--- /dev/null
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_resource_status_host.bash
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+##############################################################################
+# (c) OPNFV, Yin Kanglin and others.
+# 14_ykl@tongji.edu.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# get pacemaker resource status of hosts
+# parameter: $1 - resource name $2 status
+
+pcs resource show | grep $1 -A 3 | grep $2 \ No newline at end of file
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_vip_host.bash b/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_vip_host.bash
new file mode 100644
index 000000000..f4870fdae
--- /dev/null
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/pacemaker/get_vip_host.bash
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+##############################################################################
+# (c) OPNFV, Yin Kanglin and others.
+# 14_ykl@tongji.edu.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# get vip host in pacemaker
+# parameter: $1 - virtual ip name
+
+pcs resource show| grep -w $1 | awk '{print $4}' \ No newline at end of file
diff --git a/yardstick/benchmark/scenarios/availability/operation_conf.yaml b/yardstick/benchmark/scenarios/availability/operation_conf.yaml
index 50664d087..dc5169196 100644
--- a/yardstick/benchmark/scenarios/availability/operation_conf.yaml
+++ b/yardstick/benchmark/scenarios/availability/operation_conf.yaml
@@ -30,3 +30,8 @@ nova-create-flavor:
get-floatingip:
action_script: ha_tools/nova/get_server_floatingip.bash
rollback_script: ha_tools/nova/list_servers.bash
+
+get-vip-host:
+ action_script: ha_tools/pacemaker/get_vip_host.bash
+ rollback_script: ha_tools/pacemaker/get_resource_status.bash
+
diff --git a/yardstick/benchmark/scenarios/availability/result_checker_conf.yaml b/yardstick/benchmark/scenarios/availability/result_checker_conf.yaml
index 0494a71a7..451cc0f11 100644
--- a/yardstick/benchmark/scenarios/availability/result_checker_conf.yaml
+++ b/yardstick/benchmark/scenarios/availability/result_checker_conf.yaml
@@ -18,4 +18,6 @@ service-checker:
nova-instance-checker:
verify_script: ha_tools/nova/show_instances.bash
nova-flavor-checker:
- verify_script: ha_tools/nova/show_flavors.bash \ No newline at end of file
+ verify_script: ha_tools/nova/show_flavors.bash
+pacemaker-resource-checker:
+ verify_script: ha_tools/pacemaker/get_resource_status_host.bash \ No newline at end of file
diff --git a/yardstick/benchmark/scenarios/availability/util.py b/yardstick/benchmark/scenarios/availability/util.py
index 6fef622bd..d288fcbc1 100644
--- a/yardstick/benchmark/scenarios/availability/util.py
+++ b/yardstick/benchmark/scenarios/availability/util.py
@@ -51,6 +51,8 @@ def build_shell_command(param_config, remote=True, intermediate_variables=None):
def read_stdout_item(stdout, key):
+ if key == "all":
+ return stdout
for item in stdout.splitlines():
if key in item:
attributes = item.split("|")