Merge "Test case description and configuration file for yardstick_tc090:Control Node...
[yardstick.git] / docs / testing / user / userguide / opnfv_yardstick_tc045.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 TC045
9 *************************************
10
11 +-----------------------------------------------------------------------------+
12 |Control Node Openstack Service High Availability - Neutron Server            |
13 |                                                                             |
14 +--------------+--------------------------------------------------------------+
15 |test case id  | OPNFV_YARDSTICK_TC045: Control node Openstack service down - |
16 |              | neutron server                                               |
17 +--------------+--------------------------------------------------------------+
18 |test purpose  | This test case will verify the high availability of the      |
19 |              | network service provided by OpenStack (neutro-server) on     |
20 |              | control node.                                                |
21 |              |                                                              |
22 +--------------+--------------------------------------------------------------+
23 |test method   | This test case kills the processes of neutron-server service |
24 |              | on a selected control node, then checks whether the request  |
25 |              | of the related Openstack command is OK and the killed        |
26 |              | processes are recovered.                                     |
27 |              |                                                              |
28 +--------------+--------------------------------------------------------------+
29 |attackers     | In this test case, an attacker called "kill-process" 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 "kill-process" in this   |
33 |              | test case.                                                   |
34 |              | 2) process_name: which is the process name of the specified  |
35 |              | OpenStack service. If there are multiple processes use the   |
36 |              | same name on the host, all of them are killed by this        |
37 |              | attacker.                                                    |
38 |              | In this case. This parameter should always set to "neutron-  |
39 |              | server".                                                     |
40 |              | 3) host: which is the name of a control node being attacked. |
41 |              |                                                              |
42 |              | e.g.                                                         |
43 |              | -fault_type: "kill-process"                                  |
44 |              | -process_name: "neutron-server"                              |
45 |              | -host: node1                                                 |
46 |              |                                                              |
47 +--------------+--------------------------------------------------------------+
48 |monitors      | In this test case, two kinds of monitor are needed:          |
49 |              | 1. the "openstack-cmd" monitor constantly request a specific |
50 |              | Openstack command, which needs two parameters:               |
51 |              | 1) monitor_type: which is used for finding the monitor class |
52 |              | and related scritps. It should be always set to              |
53 |              | "openstack-cmd" for this monitor.                            |
54 |              | 2) command_name: which is the command name used for request. |
55 |              | In this case, the command name should be neutron related     |
56 |              | commands.                                                    |
57 |              |                                                              |
58 |              | 2. the "process" monitor check whether a process is running  |
59 |              | on a specific node, which needs three parameters:            |
60 |              | 1) monitor_type: which used for finding the monitor class and|
61 |              | related scritps. It should be always set to "process"        |
62 |              | for this monitor.                                            |
63 |              | 2) process_name: which is the process name for monitor       |
64 |              | 3) host: which is the name of the node runing the process    |
65 |              |                                                              |
66 |              | e.g.                                                         |
67 |              | monitor1:                                                    |
68 |              | -monitor_type: "openstack-cmd"                               |
69 |              | -command_name: "neutron agent-list"                          |
70 |              | monitor2:                                                    |
71 |              | -monitor_type: "process"                                     |
72 |              | -process_name: "neutron-server"                              |
73 |              | -host: node1                                                 |
74 |              |                                                              |
75 +--------------+--------------------------------------------------------------+
76 |metrics       | In this test case, there are two metrics:                    |
77 |              | 1)service_outage_time: which indicates the maximum outage    |
78 |              | time (seconds) of the specified Openstack command request.   |
79 |              | 2)process_recover_time: which indicates the maximun time     |
80 |              | (seconds) from the process being killed to recovered         |
81 |              |                                                              |
82 +--------------+--------------------------------------------------------------+
83 |test tool     | Developed by the project. Please see folder:                 |
84 |              | "yardstick/benchmark/scenarios/availability/ha_tools"        |
85 |              |                                                              |
86 +--------------+--------------------------------------------------------------+
87 |references    | ETSI NFV REL001                                              |
88 |              |                                                              |
89 +--------------+--------------------------------------------------------------+
90 |configuration | This test case needs two configuration files:                |
91 |              | 1) test case file: opnfv_yardstick_tc045.yaml                |
92 |              | -Attackers: see above "attackers" discription                |
93 |              | -waiting_time: which is the time (seconds) from the process  |
94 |              | being killed to stoping monitors the monitors                |
95 |              | -Monitors: see above "monitors" discription                  |
96 |              | -SLA: see above "metrics" discription                        |
97 |              |                                                              |
98 |              | 2)POD file: pod.yaml                                         |
99 |              | The POD configuration should record on pod.yaml first.       |
100 |              | the "host" item in this test case will use the node name in  |
101 |              | the pod.yaml.                                                |
102 |              |                                                              |
103 +--------------+--------------------------------------------------------------+
104 |test sequence | description and expected result                              |
105 |              |                                                              |
106 +--------------+--------------------------------------------------------------+
107 |step 1        | start monitors:                                              |
108 |              | each monitor will run with independently process             |
109 |              |                                                              |
110 |              | Result: The monitor info will be collected.                  |
111 |              |                                                              |
112 +--------------+--------------------------------------------------------------+
113 |step 2        | do attacker: connect the host through SSH, and then execute  |
114 |              | the kill process script with param value specified by        |
115 |              | "process_name"                                               |
116 |              |                                                              |
117 |              | Result: Process will be killed.                              |
118 |              |                                                              |
119 +--------------+--------------------------------------------------------------+
120 |step 3        | stop monitors after a period of time specified by            |
121 |              | "waiting_time"                                               |
122 |              |                                                              |
123 |              | Result: The monitor info will be aggregated.                 |
124 |              |                                                              |
125 +--------------+--------------------------------------------------------------+
126 |step 4        | verify the SLA                                               |
127 |              |                                                              |
128 |              | Result: The test case is passed or not.                      |
129 |              |                                                              |
130 +--------------+--------------------------------------------------------------+
131 |post-action   | It is the action when the test cases exist. It will check    |
132 |              | the status of the specified process on the host, and restart |
133 |              | the process if it is not running for next test cases.        |
134 |              |                                                              |
135 |              | Notice: This post-action uses 'lsb_release' command to check |
136 |              | the host linux distribution and determine the OpenStack      |
137 |              | service name to restart the process. Lack of 'lsb_release'   |
138 |              | on the host may cause failure to restart the process.        |
139 |              |                                                              |
140 +--------------+--------------------------------------------------------------+
141 |test verdict  | Fails only if SLA is not passed, or if there is a test case  |
142 |              | execution problem.                                           |
143 |              |                                                              |
144 +--------------+--------------------------------------------------------------+