summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Belyaninov <dbelyaninov@mirantis.com>2017-03-15 07:57:58 +0100
committerDmitry Belyaninov <dbelyaninov@mirantis.com>2017-03-22 06:39:54 +0000
commita4b9403d9084389153e6640de8bc4072b92f7b1d (patch)
treed5d1fc0e83ddf9b17fae440c67d0220ef3d831af
parentd6b67554ad401438ce31db4212c3d9f83fcd28ea (diff)
Fix for maintenance mode tests
There is problem with "--force" option for reboot command. So we should update the test accordingly. Also deprecated method was replaced. Change-Id: I87a20e0d06655b982f839cc4e073ca604d437c74 Closes-Bug: 1664487 (cherry picked from commit 7d0f33365d6a2a915f3484c6dcfe3c40a55bdcff)
Notes
Notes (review): Verified+1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+2: Alexey Stepanov <penguinolog@gmail.com> Workflow+1: Vladimir Khlyunev <vkhlyunev@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 23 Mar 2017 08:03:56 +0000 Reviewed-on: https://review.openstack.org/448408 Project: openstack/fuel-qa Branch: refs/heads/master
-rw-r--r--fuelweb_test/tests/tests_strength/test_cic_maintenance_mode.py37
1 files changed, 17 insertions, 20 deletions
diff --git a/fuelweb_test/tests/tests_strength/test_cic_maintenance_mode.py b/fuelweb_test/tests/tests_strength/test_cic_maintenance_mode.py
index e5c49e9..b4e4d48 100644
--- a/fuelweb_test/tests/tests_strength/test_cic_maintenance_mode.py
+++ b/fuelweb_test/tests/tests_strength/test_cic_maintenance_mode.py
@@ -107,9 +107,10 @@ class CICMaintenanceMode(TestBasic):
107 logger.info('Maintenance mode for node-{0}'.format(_id)) 107 logger.info('Maintenance mode for node-{0}'.format(_id))
108 asserts.assert_true('True' in check_available_mode(_ip), 108 asserts.assert_true('True' in check_available_mode(_ip),
109 "Maintenance mode is not available") 109 "Maintenance mode is not available")
110 self.ssh_manager.execute_on_remote( 110 self.ssh_manager.check_call(
111 ip=_ip, 111 ip=_ip,
112 cmd="umm on") 112 command="umm on",
113 expected=[-1])
113 114
114 self.fuel_web.wait_node_is_offline(dregular_ctrl) 115 self.fuel_web.wait_node_is_offline(dregular_ctrl)
115 116
@@ -123,9 +124,9 @@ class CICMaintenanceMode(TestBasic):
123 asserts.assert_true('True' in check_auto_mode(_ip), 124 asserts.assert_true('True' in check_auto_mode(_ip),
124 "Maintenance mode is not switched on") 125 "Maintenance mode is not switched on")
125 126
126 self.ssh_manager.execute_on_remote( 127 self.ssh_manager.check_call(
127 ip=_ip, 128 ip=_ip,
128 cmd="umm off") 129 command="umm off")
129 130
130 self.fuel_web.wait_node_is_online(dregular_ctrl) 131 self.fuel_web.wait_node_is_online(dregular_ctrl)
131 132
@@ -200,11 +201,9 @@ class CICMaintenanceMode(TestBasic):
200 logger.info('Unexpected reboot on node-{0}' 201 logger.info('Unexpected reboot on node-{0}'
201 .format(_id)) 202 .format(_id))
202 203
203 command = 'reboot --force >/dev/null & ' 204 self.ssh_manager.check_call(
204
205 self.ssh_manager.execute_on_remote(
206 ip=_ip, 205 ip=_ip,
207 cmd=command) 206 command='reboot >/dev/null & ')
208 207
209 wait(lambda: 208 wait(lambda:
210 not checkers.check_ping(self.env.get_admin_node_ip(), 209 not checkers.check_ping(self.env.get_admin_node_ip(),
@@ -228,9 +227,9 @@ class CICMaintenanceMode(TestBasic):
228 "Maintenance mode is not switched on") 227 "Maintenance mode is not switched on")
229 228
230 logger.info('turn off Maintenance mode') 229 logger.info('turn off Maintenance mode')
231 self.ssh_manager.execute_on_remote( 230 self.ssh_manager.check_call(
232 ip=_ip, 231 ip=_ip,
233 cmd="umm off") 232 command="umm off")
234 time.sleep(30) 233 time.sleep(30)
235 234
236 change_config(_ip) 235 change_config(_ip)
@@ -303,9 +302,9 @@ class CICMaintenanceMode(TestBasic):
303 302
304 asserts.assert_true('True' in check_available_mode(_ip), 303 asserts.assert_true('True' in check_available_mode(_ip),
305 "Maintenance mode is not available") 304 "Maintenance mode is not available")
306 self.ssh_manager.execute_on_remote( 305 self.ssh_manager.check_call(
307 ip=_ip, 306 ip=_ip,
308 cmd="umm disable") 307 command="umm disable")
309 308
310 asserts.assert_false('True' in check_available_mode(_ip), 309 asserts.assert_false('True' in check_available_mode(_ip),
311 "Maintenance mode should not be available") 310 "Maintenance mode should not be available")
@@ -313,10 +312,10 @@ class CICMaintenanceMode(TestBasic):
313 logger.info('Try to execute maintenance mode ' 312 logger.info('Try to execute maintenance mode '
314 'for node-{0}'.format(_id)) 313 'for node-{0}'.format(_id))
315 314
316 self.ssh_manager.execute_on_remote( 315 self.ssh_manager.check_call(
317 ip=_ip, 316 ip=_ip,
318 cmd="umm on", 317 command="umm on",
319 assert_ec_equal=[1]) 318 expected=[1])
320 319
321 # If we don't disable maintenance mode, 320 # If we don't disable maintenance mode,
322 # the node would have gone to reboot, so we just expect 321 # the node would have gone to reboot, so we just expect
@@ -375,14 +374,12 @@ class CICMaintenanceMode(TestBasic):
375 asserts.assert_false('True' in check_available_mode(_ip), 374 asserts.assert_false('True' in check_available_mode(_ip),
376 "Maintenance mode should not be available") 375 "Maintenance mode should not be available")
377 376
378 command = 'reboot --force >/dev/null & '
379
380 logger.info('Unexpected reboot on node-{0}' 377 logger.info('Unexpected reboot on node-{0}'
381 .format(_id)) 378 .format(_id))
382 379
383 self.ssh_manager.execute_on_remote( 380 self.ssh_manager.check_call(
384 ip=_ip, 381 ip=_ip,
385 cmd=command) 382 command='reboot >/dev/null & ')
386 383
387 wait(lambda: 384 wait(lambda:
388 not checkers.check_ping(self.env.get_admin_node_ip(), 385 not checkers.check_ping(self.env.get_admin_node_ip(),
@@ -392,7 +389,7 @@ class CICMaintenanceMode(TestBasic):
392 dregular_ctrl.name)) 389 dregular_ctrl.name))
393 390
394 # Node don't have enough time for set offline status 391 # Node don't have enough time for set offline status
395 # after reboot --force 392 # after reboot
396 # Just waiting 393 # Just waiting
397 394
398 asserts.assert_true( 395 asserts.assert_true(