a034471aa1d9a2d8810e89db473371437aebc635
[yardstick.git] / tests / opnfv / test_cases / opnfv_yardstick_tc093.yaml
1 ##############################################################################
2 ## Copyright (c) 2018 Intracom Telecom and others.
3 ##
4 ## All rights reserved. This program and the accompanying materials
5 ## are made available under the terms of the Apache License, Version 2.0
6 ## which accompanies this distribution, and is available at
7 ## http://www.apache.org/licenses/LICENSE-2.0
8 ###############################################################################
9 ---
10
11 schema: "yardstick:task:0.1"
12 description: >
13     Yardstick TC093 config file;
14     SDN Vswitch resilience in non-HA or HA configuration
15
16 {% set file = file or '/etc/yardstick/pod.yaml' %}
17 {% set attack_host_cmp_one = attack_host_cmp_one or 'node4' %}
18 {% set attack_host_cmp_two = attack_host_cmp_two or 'node5' %}
19 {% set systemd_service_name = systemd_service_name or 'openvswitch-switch'%}
20
21 scenarios:
22
23 -
24       type: "GeneralHA"
25       options:
26           monitors:
27
28             - monitor_type: "general-monitor"
29               monitor_key: "ip-status"
30               key: "snat"
31               monitor_time: 50
32               host: athena
33               sla:
34                  max_outage_time: 0
35               parameter:
36                 destination_ip: "8.8.8.8"
37
38             - monitor_type: "general-monitor"
39               monitor_key: "ip-status"
40               key: "l2"
41               monitor_time: 50
42               host: athena
43               sla:
44                  max_outage_time: 0
45               parameter:
46                 destination_ip: "@private_ip"
47
48           operations:
49             - operation_type: "general-operation"
50               key: "get-privateip"
51               operation_key: "get-privateip"
52               action_parameter:
53                 server_name: "ares"
54               return_parameter:
55                 all: "@private_ip"
56
57
58           steps:
59             - actionKey: "get-privateip"
60               actionType: "operation"
61               index: 1
62
63             - actionKey: "l2"
64               actionType: "monitor"
65               index: 2
66
67             - actionKey: "snat"
68               actionType: "monitor"
69               index: 3
70
71
72       nodes:
73         athena: athena.ODLnoHA1
74       runner:
75         type: Duration
76         duration: 1
77       sla:
78         action: monitor
79
80
81 -
82       type: "GeneralHA"
83       options:
84           attackers:
85             -
86               fault_type: "kill-process"
87               process_name: "openvswitch"
88               key: "kill-process-cmp-one"
89               host: {{attack_host_cmp_one}}
90
91             -
92               fault_type: "kill-process"
93               process_name: "openvswitch"
94               key: "kill-process-cmp-two"
95               host: {{attack_host_cmp_two}}
96
97           monitors:
98             - monitor_type: "process"
99               process_name: "openvswitch"
100               host: {{attack_host_cmp_one}}
101               key: "monitor-recovery-cmp-one"
102               monitor_time: 50
103               sla:
104                 max_recover_time: 30
105
106             - monitor_type: "process"
107               process_name: "openvswitch"
108               host: {{attack_host_cmp_two}}
109               key: "monitor-recovery-cmp-two"
110               monitor_time: 50
111               sla:
112                 max_recover_time: 30
113
114             - monitor_type: "general-monitor"
115               monitor_key: "ip-status"
116               key: "snat"
117               monitor_time: 70
118               host: athena
119               sla:
120                  max_outage_time: 20
121               parameter:
122                 destination_ip: "8.8.8.8"
123
124             - monitor_type: "general-monitor"
125               monitor_key: "ip-status"
126               key: "l2"
127               monitor_time: 70
128               host: athena
129               sla:
130                  max_outage_time: 20
131               parameter:
132                 destination_ip: "@private_ip"
133
134           operations:
135             - operation_type: "general-operation"
136               key: "restart-service-cmp-one"
137               host: {{attack_host_cmp_one}}
138               operation_key: "start-service"
139               action_parameter:
140                 service: {{systemd_service_name ~ " restart"}}
141               rollback_parameter:
142                 service: "openvswitch"
143
144             - operation_type: "general-operation"
145               key: "restart-service-cmp-two"
146               host: {{attack_host_cmp_two}}
147               operation_key: "start-service"
148               action_parameter:
149                 service: {{systemd_service_name ~ " restart"}}
150               rollback_parameter:
151                 service: "openvswitch"
152
153             - operation_type: "general-operation"
154               key: "get-privateip"
155               operation_key: "get-privateip"
156               action_parameter:
157                 server_name: "ares"
158               return_parameter:
159                 all: "@private_ip"
160
161
162
163           steps:
164
165             - actionKey: "get-privateip"
166               actionType: "operation"
167               index: 1
168
169             - actionKey: "l2"
170               actionType: "monitor"
171               index: 2
172
173             - actionKey: "snat"
174               actionType: "monitor"
175               index: 3
176
177             - actionKey: "kill-process-cmp-one"
178               actionType: "attacker"
179               index: 4
180
181             - actionKey: "kill-process-cmp-two"
182               actionType: "attacker"
183               index: 5
184
185             - actionKey: "monitor-recovery-cmp-one"
186               actionType: "monitor"
187               index: 6
188
189             - actionKey: "monitor-recovery-cmp-two"
190               actionType: "monitor"
191               index: 7
192
193
194             - actionKey: "restart-service-cmp-one"
195               actionType: "operation"
196               index: 8
197
198             - actionKey: "restart-service-cmp-two"
199               actionType: "operation"
200               index: 9
201
202
203       nodes:
204         {{attack_host_cmp_one}}: {{attack_host_cmp_one}}.LF
205         {{attack_host_cmp_two}}: {{attack_host_cmp_two}}.LF
206         athena: athena.ODLnoHA1
207       runner:
208         type: Duration
209         duration: 1
210       sla:
211         action: monitor
212
213 -
214       type: "GeneralHA"
215       options:
216           monitors:
217
218             - monitor_type: "general-monitor"
219               monitor_key: "ip-status"
220               key: "l2"
221               monitor_time: 80
222               host: athena
223               sla:
224                  max_outage_time: 40
225               parameter:
226                 destination_ip: "@private_ip"
227
228           operations:
229             - operation_type: "general-operation"
230               key: "get-privateip"
231               operation_key: "get-privateip"
232               action_parameter:
233                 server_name: "hermes"
234               return_parameter:
235                 all: "@private_ip"
236
237             - operation_type: "general-operation"
238               key: "nova-create-instance"
239               operation_key: "nova-create-instance"
240               action_parameter:
241                 serverconfig: "hermes yardstick-image yardstick-flavor test_one"
242               rollback_parameter:
243                 serverconfig: "hermes"
244
245             - operation_type: "general-operation"
246               key: "add-server-to-secgroup"
247               operation_key: "add-server-to-secgroup"
248               action_parameter:
249                 serverconfig: "hermes ODLnoHA1"
250               rollback_parameter:
251                 serverconfig: "hermes ODLnoHA1"
252
253
254           steps:
255             - actionKey: "nova-create-instance"
256               actionType: "operation"
257               index: 1
258
259             - actionKey: "add-server-to-secgroup"
260               actionType: "operation"
261               index: 2
262
263             - actionKey: "get-privateip"
264               actionType: "operation"
265               index: 3
266
267             - actionKey: "l2"
268               actionType: "monitor"
269               index: 4
270
271       nodes:
272         athena: athena.ODLnoHA1
273       runner:
274         type: Duration
275         duration: 1
276       sla:
277         action: monitor
278
279
280 contexts:
281     -
282         type: Node
283         name: LF
284         file: {{file}}
285     -
286         name: ODLnoHA1
287         image: yardstick-image
288         flavor: yardstick-flavor
289         user: ubuntu
290         host: athena
291         placement_groups:
292             pgrp1:
293                 policy: "availability"
294         servers:
295             athena:
296                 floating_ip: true
297                 placement: "pgrp1"
298                 network_ports:
299                     test_one:
300                         - ens0
301
302             ares:
303                 floating_ip: true
304                 placement: "pgrp1"
305                 network_ports:
306                     test_one:
307                         - ens0
308
309         networks:
310             test_one:
311                 cidr: '10.0.1.0/24'
312                 router: 'test_router'
313