Add assertion for length of active_slaves list

We should  assert that active_slaves list is not empty
before try tp get some data from
it by index in test 3_in_1_rabbit_failover

Change-Id: I0aae748bbd76da9acc81709e38d34c43d5e06a94
Closes-Bug: #1509244
This commit is contained in:
Tatyana Leontovich 2015-10-23 11:33:45 +03:00
parent 9820204de0
commit 974c95ca15
1 changed files with 5 additions and 0 deletions

View File

@ -1053,6 +1053,8 @@ class TestHaFailoverBase(TestBasic):
active_slaves = [slave for slave
in d_ctrls
if slave.name != rabbit_slaves[0].name]
logger.debug('Active slaves are {0}'.format(active_slaves))
assert_true(active_slaves, 'Can not find any active slaves')
master_rabbit_after_slave_fail = self.fuel_web.get_rabbit_master_node(
active_slaves[0].name)
@ -1105,6 +1107,9 @@ class TestHaFailoverBase(TestBasic):
active_slaves = [slave for slave
in d_ctrls
if slave.name != master_rabbit.name]
logger.debug('Active slaves are {0}'.format(active_slaves))
assert_true(active_slaves, 'Can not find any active slaves')
master_rabbit_after_fail = self.fuel_web.get_rabbit_master_node(
active_slaves[0].name)
assert_not_equal(master_rabbit.name, master_rabbit_after_fail.name)