blob: a8bb6b8fc646116573aa1201f7dbd39075a50770 [file] [log] [blame]
Tatyana Leontoviche5ccdb32017-10-09 20:10:43 +03001# Copyright 2017 Mirantis, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15import pytest
16
17from tcp_tests import logger
18
19LOG = logger.logger
20
21
22class TestFailover(object):
23 """Test class for testing OpenStack nodes failover"""
24
25 @pytest.mark.grab_versions
26 @pytest.mark.fail_snapshot
27 def test_warm_shutdown_ctl01_node(self, underlay, openstack_deployed,
28 openstack_actions, show_step):
29 """Test warm shutdown ctl01
30
31 Scenario:
32 1. Prepare salt on hosts
33 2. Setup controller nodes
34 3. Setup compute nodes
35 4. Shutdown ctl01
36 5. Run tempest smoke after failover
37
38
39 """
40 # STEP #1,2,3
41 show_step(1)
42 show_step(2)
43 show_step(3)
44 # STEP #4
45 show_step(4)
46 openstack_actions.warm_shutdown_openstack_nodes('ctl01')
47 # STEP #5
48 show_step(5)
49 openstack_actions.run_tempest(pattern='smoke')
50
51 LOG.info("*************** DONE **************")
52
53 @pytest.mark.grab_versions
54 @pytest.mark.fail_snapshot
55 def test_restart_ctl01_node(self, underlay, openstack_deployed,
56 openstack_actions, show_step):
57 """Test restart ctl01
58
59 Scenario:
60 1. Prepare salt on hosts
61 2. Setup controller nodes
62 3. Setup compute nodes
63 4. Restart ctl01
64 5. Run tempest smoke after failover
65
66
67 """
68 # STEP #1,2,3
69 show_step(1)
70 show_step(2)
71 show_step(3)
72
73 # STEP #4
74 show_step(4)
75 openstack_actions.warm_restart_nodes('ctl01')
76 # STEP #5
77 show_step(5)
78 openstack_actions.run_tempest(pattern='smoke')
79
80 LOG.info("*************** DONE **************")
81
82 @pytest.mark.grab_versions
83 @pytest.mark.fail_snapshot
84 def test_warm_shutdown_cmp01_node(self, underlay, openstack_deployed,
85 openstack_actions, show_step):
86 """Test warm shutdown cmp01
87
88 Scenario:
89 1. Prepare salt on hosts
90 2. Setup controller nodes
91 3. Setup compute nodes
92 4. Shutdown cmp01
93 5. Run tempest smoke after failover
94
95
96 """
97 # STEP #1,2,3
98 show_step(1)
99 show_step(2)
100 show_step(3)
101
102 # STEP #4
103 show_step(4)
104 openstack_actions.warm_shutdown_openstack_nodes('cmp01')
105 # STEP #5
106 show_step(5)
107 openstack_actions.run_tempest(pattern='smoke')
108
109 LOG.info("*************** DONE **************")
110
111 @pytest.mark.grab_versions
112 @pytest.mark.fail_snapshot
113 def test_restart_cmp01_node(self, underlay, openstack_deployed,
114 openstack_actions, show_step):
115 """Test restart cmp01
116
117 Scenario:
118 1. Prepare salt on hosts
119 2. Setup controller nodes
120 3. Setup compute nodes
121 4. Restart cmp01
122 5. Run tempest smoke after failover
123
124
125 """
126 # STEP #1,2,3
127 show_step(1)
128 show_step(2)
129 show_step(3)
130
131 # STEP #4
132 show_step(4)
133 openstack_actions.warm_restart_nodes('cmp01')
134 # STEP #5
135 show_step(5)
136 openstack_actions.run_tempest(pattern='smoke')
137
138 LOG.info("*************** DONE **************")
139
140 @pytest.mark.grab_versions
141 @pytest.mark.fail_snapshot
142 def test_restart_mon01_node(self, underlay, openstack_deployed,
143 openstack_actions, sl_deployed,
144 show_step):
145 """Test restart mon01
146
147 Scenario:
148 1. Prepare salt on hosts
149 2. Setup controller nodes
150 3. Setup compute, monitoring nodes
151 4. Restart mon01
152 5. Run LMA smoke after failover
153
154
155 """
156 # STEP #1,2,3
157 show_step(1)
158 show_step(2)
159 show_step(3)
160
161 # STEP #4
162 show_step(4)
163 openstack_actions.warm_restart_nodes('mon01')
164 # STEP #5
165 show_step(5)
166 # Run SL component tetsts
167 sl_deployed.run_sl_functional_tests(
168 'cfg01',
169 '/root/stacklight-pytest/stacklight_tests/',
170 'tests/prometheus/test_smoke.py',
171 'test_alerts.py')
172 LOG.info("*************** DONE **************")
173
174 @pytest.mark.grab_versions
175 @pytest.mark.fail_snapshot
176 def test_warm_shutdown_mon01_node(self, underlay, openstack_deployed,
177 openstack_actions, sl_deployed,
178 show_step):
179 """Test warm shutdown mon01
180
181 Scenario:
182 1. Prepare salt on hosts
183 2. Setup controller nodes
184 3. Setup compute, monitoring nodes
185 4. Shutdown mon01
186 5. Run LMA smoke after failover
187
188
189 """
190 # STEP #1,2,3
191 show_step(1)
192 show_step(2)
193 show_step(3)
194
195 # STEP #4
196 show_step(4)
197 openstack_actions.warm_shutdown_openstack_nodes('mon01')
198 # STEP #5
199 show_step(5)
200 sl_deployed.run_sl_functional_tests(
201 'cfg01',
202 '/root/stacklight-pytest/stacklight_tests/',
203 'tests/prometheus/test_smoke.py',
204 'test_alerts.py')
205 LOG.info("*************** DONE **************")