Bugfix: interface down HA tc050 attack and monitor logistic wrong
[yardstick.git] / docs / testing / user / userguide / opnfv_yardstick_tc050.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International
2 .. License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) OPNFV, Yin Kanglin and others.
5 .. 14_ykl@tongji.edu.cn
6
7 *************************************
8 Yardstick Test Case Description TC050
9 *************************************
10
11 +-----------------------------------------------------------------------------+
12 |OpenStack Controller Node Network High Availability                          |
13 |                                                                             |
14 +--------------+--------------------------------------------------------------+
15 |test case id  | OPNFV_YARDSTICK_TC050: OpenStack Controller Node Network     |
16 |              | High Availability                                            |
17 +--------------+--------------------------------------------------------------+
18 |test purpose  | This test case will verify the high availability of control  |
19 |              | node. When one of the controller failed to connect the       |
20 |              | network, which breaks down the Openstack services on this    |
21 |              | node. These Openstack service should able to be accessed by  |
22 |              | other controller nodes, and the services on failed           |
23 |              | controller node should be isolated.                          |
24 +--------------+--------------------------------------------------------------+
25 |test method   | This test case turns off the network interfaces of a         |
26 |              | specified control node, then checks whether all services     |
27 |              | provided by the control node are OK with some monitor tools. |
28 +--------------+--------------------------------------------------------------+
29 |attackers     | In this test case, an attacker called "close-interface" is   |
30 |              | needed. This attacker includes three parameters:             |
31 |              | 1) fault_type: which is used for finding the attacker's      |
32 |              | scripts. It should be always set to "close-interface" in     |
33 |              | this test case.                                              |
34 |              | 2) host: which is the name of a control node being attacked. |
35 |              | 3) interface: the network interface to be turned off.        |
36 |              |                                                              |
37 |              | The interface to be closed by the attacker can be set by the |
38 |              | variable of "{{ interface_name }}"                           |
39 |              |                                                              |
40 |              | attackers:                                                   |
41 |              |   -                                                          |
42 |              |     fault_type: "general-attacker"                           |
43 |              |     host: {{ attack_host }}                                  |
44 |              |     key: "close-br-public"                                   |
45 |              |     attack_key: "close-interface"                            |
46 |              |     action_parameter:                                        |
47 |              |       interface: {{ interface_name }}                        |
48 |              |     rollback_parameter:                                      |
49 |              |       interface: {{ interface_name }}                        |
50 |              |                                                              |
51 +--------------+--------------------------------------------------------------+
52 |monitors      | In this test case, the monitor named "openstack-cmd" is      |
53 |              | needed. The monitor needs needs two parameters:              |
54 |              | 1) monitor_type: which is used for finding the monitor class |
55 |              | and related scritps. It should be always set to              |
56 |              | "openstack-cmd" for this monitor.                            |
57 |              | 2) command_name: which is the command name used for request  |
58 |              |                                                              |
59 |              | There are four instance of the "openstack-cmd" monitor:      |
60 |              | monitor1:                                                    |
61 |              |     - monitor_type: "openstack-cmd"                          |
62 |              |     - command_name: "nova image-list"                        |
63 |              | monitor2:                                                    |
64 |              |     - monitor_type: "openstack-cmd"                          |
65 |              |     - command_name: "neutron router-list"                    |
66 |              | monitor3:                                                    |
67 |              |     - monitor_type: "openstack-cmd"                          |
68 |              |     - command_name: "heat stack-list"                        |
69 |              | monitor4:                                                    |
70 |              |     - monitor_type: "openstack-cmd"                          |
71 |              |     - command_name: "cinder list"                            |
72 +--------------+--------------------------------------------------------------+
73 |metrics       | In this test case, there is one metric:                      |
74 |              | 1)service_outage_time: which indicates the maximum outage    |
75 |              | time (seconds) of the specified Openstack command request.   |
76 +--------------+--------------------------------------------------------------+
77 |test tool     | Developed by the project. Please see folder:                 |
78 |              | "yardstick/benchmark/scenarios/availability/ha_tools"        |
79 |              |                                                              |
80 +--------------+--------------------------------------------------------------+
81 |references    | ETSI NFV REL001                                              |
82 |              |                                                              |
83 +--------------+--------------------------------------------------------------+
84 |configuration | This test case needs two configuration files:                |
85 |              | 1) test case file: opnfv_yardstick_tc050.yaml                |
86 |              | -Attackers: see above "attackers" discription                |
87 |              | -waiting_time: which is the time (seconds) from the process  |
88 |              | being killed to stoping monitors the monitors                |
89 |              | -Monitors: see above "monitors" discription                  |
90 |              | -SLA: see above "metrics" discription                        |
91 |              |                                                              |
92 |              | 2)POD file: pod.yaml                                         |
93 |              | The POD configuration should record on pod.yaml first.       |
94 |              | the "host" item in this test case will use the node name in  |
95 |              | the pod.yaml.                                                |
96 |              |                                                              |
97 +--------------+--------------------------------------------------------------+
98 |test sequence | description and expected result                              |
99 |              |                                                              |
100 +--------------+--------------------------------------------------------------+
101 |step 1        | start monitors:                                              |
102 |              | each monitor will run with independently process             |
103 |              |                                                              |
104 |              | Result: The monitor info will be collected.                  |
105 |              |                                                              |
106 +--------------+--------------------------------------------------------------+
107 |step 2        | do attacker: connect the host through SSH, and then execute  |
108 |              | the turnoff network interface script with param value        |
109 |              | specified by "{{ interface_name }}".                         |
110 |              |                                                              |
111 |              | Result: The specified network interface will be down.        |
112 |              |                                                              |
113 +--------------+--------------------------------------------------------------+
114 |step 3        | stop monitors after a period of time specified by            |
115 |              | "waiting_time"                                               |
116 |              |                                                              |
117 |              | Result: The monitor info will be aggregated.                 |
118 |              |                                                              |
119 +--------------+--------------------------------------------------------------+
120 |step 4        | verify the SLA                                               |
121 |              |                                                              |
122 |              | Result: The test case is passed or not.                      |
123 |              |                                                              |
124 +--------------+--------------------------------------------------------------+
125 |post-action   | It is the action when the test cases exist. It turns up the  |
126 |              | network interface of the control node if it is not turned    |
127 |              | up.                                                          |
128 +--------------+--------------------------------------------------------------+
129 |test verdict  | Fails only if SLA is not passed, or if there is a test case  |
130 |              | execution problem.                                           |
131 |              |                                                              |
132 +--------------+--------------------------------------------------------------+
133