Browse Source

Merge "Fix for maintenance mode tests"

Jenkins 2 years ago
parent
commit
2bf71ef146
1 changed files with 17 additions and 20 deletions
  1. 17
    20
      fuelweb_test/tests/tests_strength/test_cic_maintenance_mode.py

+ 17
- 20
fuelweb_test/tests/tests_strength/test_cic_maintenance_mode.py View File

@@ -107,9 +107,10 @@ class CICMaintenanceMode(TestBasic):
107 107
         logger.info('Maintenance mode for node-{0}'.format(_id))
108 108
         asserts.assert_true('True' in check_available_mode(_ip),
109 109
                             "Maintenance mode is not available")
110
-        self.ssh_manager.execute_on_remote(
110
+        self.ssh_manager.check_call(
111 111
             ip=_ip,
112
-            cmd="umm on")
112
+            command="umm on",
113
+            expected=[-1])
113 114
 
114 115
         self.fuel_web.wait_node_is_offline(dregular_ctrl)
115 116
 
@@ -123,9 +124,9 @@ class CICMaintenanceMode(TestBasic):
123 124
         asserts.assert_true('True' in check_auto_mode(_ip),
124 125
                             "Maintenance mode is not switched on")
125 126
 
126
-        self.ssh_manager.execute_on_remote(
127
+        self.ssh_manager.check_call(
127 128
             ip=_ip,
128
-            cmd="umm off")
129
+            command="umm off")
129 130
 
130 131
         self.fuel_web.wait_node_is_online(dregular_ctrl)
131 132
 
@@ -200,11 +201,9 @@ class CICMaintenanceMode(TestBasic):
200 201
         logger.info('Unexpected reboot on node-{0}'
201 202
                     .format(_id))
202 203
 
203
-        command = 'reboot --force >/dev/null & '
204
-
205
-        self.ssh_manager.execute_on_remote(
204
+        self.ssh_manager.check_call(
206 205
             ip=_ip,
207
-            cmd=command)
206
+            command='reboot >/dev/null & ')
208 207
 
209 208
         wait(lambda:
210 209
              not checkers.check_ping(self.env.get_admin_node_ip(),
@@ -228,9 +227,9 @@ class CICMaintenanceMode(TestBasic):
228 227
                             "Maintenance mode is not switched on")
229 228
 
230 229
         logger.info('turn off Maintenance mode')
231
-        self.ssh_manager.execute_on_remote(
230
+        self.ssh_manager.check_call(
232 231
             ip=_ip,
233
-            cmd="umm off")
232
+            command="umm off")
234 233
         time.sleep(30)
235 234
 
236 235
         change_config(_ip)
@@ -303,9 +302,9 @@ class CICMaintenanceMode(TestBasic):
303 302
 
304 303
         asserts.assert_true('True' in check_available_mode(_ip),
305 304
                             "Maintenance mode is not available")
306
-        self.ssh_manager.execute_on_remote(
305
+        self.ssh_manager.check_call(
307 306
             ip=_ip,
308
-            cmd="umm disable")
307
+            command="umm disable")
309 308
 
310 309
         asserts.assert_false('True' in check_available_mode(_ip),
311 310
                              "Maintenance mode should not be available")
@@ -313,10 +312,10 @@ class CICMaintenanceMode(TestBasic):
313 312
         logger.info('Try to execute maintenance mode '
314 313
                     'for node-{0}'.format(_id))
315 314
 
316
-        self.ssh_manager.execute_on_remote(
315
+        self.ssh_manager.check_call(
317 316
             ip=_ip,
318
-            cmd="umm on",
319
-            assert_ec_equal=[1])
317
+            command="umm on",
318
+            expected=[1])
320 319
 
321 320
         # If we don't disable maintenance mode,
322 321
         # the node would have gone to reboot, so we just expect
@@ -375,14 +374,12 @@ class CICMaintenanceMode(TestBasic):
375 374
         asserts.assert_false('True' in check_available_mode(_ip),
376 375
                              "Maintenance mode should not be available")
377 376
 
378
-        command = 'reboot --force >/dev/null & '
379
-
380 377
         logger.info('Unexpected reboot on node-{0}'
381 378
                     .format(_id))
382 379
 
383
-        self.ssh_manager.execute_on_remote(
380
+        self.ssh_manager.check_call(
384 381
             ip=_ip,
385
-            cmd=command)
382
+            command='reboot >/dev/null & ')
386 383
 
387 384
         wait(lambda:
388 385
              not checkers.check_ping(self.env.get_admin_node_ip(),
@@ -392,7 +389,7 @@ class CICMaintenanceMode(TestBasic):
392 389
                  dregular_ctrl.name))
393 390
 
394 391
         # Node don't have enough time for set offline status
395
-        # after reboot --force
392
+        # after reboot
396 393
         # Just waiting
397 394
 
398 395
         asserts.assert_true(

Loading…
Cancel
Save