Add intermediate variables for attacker,monitor,result_checker
[yardstick.git] / tests / opnfv / test_cases / opnfv_yardstick_tc057.yaml
1 ##############################################################################
2 # Copyright (c) 2017 14_ykl@tongji.edu.cn 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     Test case for TC057 :OpenStack Controller Cluster Management Service High
14     Availability;
15     This test case is written by scenario-based HA testing framework.
16
17 {% set file = file or '/etc/yardstick/pod.yaml' %}
18 {% set vip_mgmt = vip_mgmt or 'vip__management' %}
19 {% set vip_vrouter = vip_vrouter or 'vip__vrouter' %}
20 {% set attack_host = attack_host or 'node1' %}
21 {% set check_host = check_host or 'node2' %}
22 {% set monitor_time = monitor_time or 10 %}
23 {% set monitor_number = monitor_number or 3 %}
24
25 scenarios:
26   -
27     type: "GeneralHA"
28     options:
29       attackers:
30         -
31           fault_type: "general-attacker"
32           host: {{attack_host}}
33           key: "kill-process"
34           attack_key: "kill-corosync"
35           action_parameter:
36             process_name: "corosync"
37
38       monitors:
39         -
40           monitor_type: "openstack-cmd"
41           key: "check-nova-service"
42           command_name: "openstack image list"
43           monitor_time: {{monitor_time}}
44           monitor_number: {{monitor_number}}
45           sla:
46             max_outage_time: 5
47
48         -
49           monitor_type: "openstack-cmd"
50           key: "check-neutron-service"
51           command_name: "openstack network list"
52           monitor_time: {{monitor_time}}
53           monitor_number: {{monitor_number}}
54           sla:
55             max_outage_time: 5
56
57         -
58           monitor_type: "openstack-cmd"
59           key: "check-keystone-service"
60           command_name: "openstack user list"
61           monitor_time: {{monitor_time}}
62           monitor_number: {{monitor_number}}
63           sla:
64             max_outage_time: 5
65
66         -
67           monitor_type: "openstack-cmd"
68           key: "check-heat-service"
69           command_name: "openstack stack list"
70           monitor_time: {{monitor_time}}
71           monitor_number: {{monitor_number}}
72           sla:
73             max_outage_time: 5
74
75       operations:
76         -
77           operation_type: "general-operation"
78           key: "get-mgmt-vip-host"
79           operation_key: "get-vip-host"
80           host: {{check_host}}
81           action_parameter:
82             vip_name: {{vip_mgmt}}
83           return_parameter:
84             all: "@vip_mgmt_host"
85
86         -
87           operation_type: "general-operation"
88           key: "get-router-vip-host"
89           operation_key: "get-vip-host"
90           host: {{check_host}}
91           action_parameter:
92             vip_name: {{vip_vrouter}}
93           return_parameter:
94             all: "@vip_router_host"
95
96       resultCheckers:
97         -
98           checker_type: "general-result-checker"
99           key: "check-rabbitmq-master"
100           checker_key: "pacemaker-resource-checker"
101           host: {{check_host}}
102           parameter:
103             resource_name: "p_rabbitmq-server"
104             resource_host: "@vip_mgmt_host"
105           expectedValue: "Masters"
106           condition: "in"
107
108         -
109           checker_type: "general-result-checker"
110           key: "check-conntrackd-master"
111           checker_key: "pacemaker-resource-checker"
112           host: {{check_host}}
113           parameter:
114             resource_name: "p_conntrackd"
115             resource_host: "@vip_router_host"
116           expectedValue: "Masters"
117           condition: "in"
118
119       steps:
120         -
121           actionKey: "kill-process"
122           actionType: "attacker"
123           index: 1
124
125         -
126           actionKey: "check-nova-service"
127           actionType: "monitor"
128           index: 2
129
130         -
131           actionKey: "check-neutron-service"
132           actionType: "monitor"
133           index: 3
134
135         -
136           actionKey: "check-keystone-service"
137           actionType: "monitor"
138           index: 4
139
140         -
141           actionKey: "check-heat-service"
142           actionType: "monitor"
143           index: 5
144
145         -
146           actionKey: "get-mgmt-vip-host"
147           actionType: "operation"
148           index: 6
149
150         -
151           actionKey: "check-rabbitmq-master"
152           actionType: "resultchecker"
153           index: 7
154
155         -
156           actionKey: "get-router-vip-host"
157           actionType: "operation"
158           index: 8
159
160         -
161           actionKey: "check-conntrackd-master"
162           actionType: "resultchecker"
163           index: 9
164
165
166     nodes:
167       {{attack_host}}: {{attack_host}}.LF
168       {{check_host}}: {{check_host}}.LF
169     runner:
170       type: Duration
171       duration: 1
172     sla:
173       outage_time: 5
174       action: monitor
175
176 context:
177   type: Node
178   name: LF
179   file: {{file}}