Fix getting first/second ctrls in the test 'ha_neutron_destructive'
- use the list of non-primary devops nodes instead of getting controllers inside the loop; - use self.show_step() for monitor steps position in logs Change-Id: I9d81cf9479a862f167059580f2e6a8431835e48e Closes-Bug:#1509286
This commit is contained in:
parent
6379e5dc56
commit
c83e2a7d02
|
@ -51,13 +51,14 @@ class TestHaNeutronFailover(TestHaFailoverBase):
|
||||||
"""Destroy two controllers and check pacemaker status is correct
|
"""Destroy two controllers and check pacemaker status is correct
|
||||||
|
|
||||||
Scenario:
|
Scenario:
|
||||||
1. Destroy first controller
|
1. Revert environment
|
||||||
2. Check pacemaker status
|
2. Destroy first controller
|
||||||
3. Run OSTF
|
3. Check pacemaker status
|
||||||
4. Revert environment
|
4. Run OSTF
|
||||||
5. Destroy second controller
|
5. Revert environment
|
||||||
6. Check pacemaker status
|
6. Destroy second controller
|
||||||
7. Run OSTF
|
7. Check pacemaker status
|
||||||
|
8. Run OSTF
|
||||||
|
|
||||||
Duration 35m
|
Duration 35m
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -142,29 +142,34 @@ class TestHaFailoverBase(TestBasic):
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
controllers = []
|
|
||||||
|
|
||||||
for num in xrange(2):
|
for num in xrange(2):
|
||||||
|
|
||||||
|
# STEP: Revert environment
|
||||||
|
# if num==0: show_step(1); if num==1: show_step(5)
|
||||||
|
self.show_step([1, 5][num])
|
||||||
self.env.revert_snapshot(self.snapshot_name)
|
self.env.revert_snapshot(self.snapshot_name)
|
||||||
|
|
||||||
cluster_id = self.fuel_web.client.get_cluster_id(
|
cluster_id = self.fuel_web.client.get_cluster_id(
|
||||||
self.__class__.__name__)
|
self.__class__.__name__)
|
||||||
|
controllers = list(get_needed_controllers(cluster_id))
|
||||||
|
|
||||||
if not controllers:
|
# STEP: Destroy first/second controller
|
||||||
controllers = get_needed_controllers(cluster_id)
|
devops_node = controllers[num]
|
||||||
|
# if num==0: show_step(2); if num==1: show_step(6)
|
||||||
devops_node = self.fuel_web.get_devops_node_by_nailgun_node(
|
self.show_step([2, 6][num], details="Suspending node: "
|
||||||
controllers.pop(0))
|
"{0}".format(devops_node.name))
|
||||||
devops_node.suspend(False)
|
devops_node.suspend(False)
|
||||||
|
|
||||||
|
# STEP: Check pacemaker status
|
||||||
|
self.show_step([3, 7][num])
|
||||||
n_ctrls = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
n_ctrls = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||||
cluster_id=cluster_id,
|
cluster_id=cluster_id,
|
||||||
roles=['controller'])
|
roles=['controller'])
|
||||||
d_ctrls = self.fuel_web.get_devops_nodes_by_nailgun_nodes(n_ctrls)
|
d_ctrls = self.fuel_web.get_devops_nodes_by_nailgun_nodes(n_ctrls)
|
||||||
|
|
||||||
self.fuel_web.assert_pacemaker(
|
self.fuel_web.assert_pacemaker(
|
||||||
(set(d_ctrls) - set(devops_node))[0].name,
|
(set(d_ctrls) - set([devops_node])).pop().name,
|
||||||
set(d_ctrls) - set(devops_node),
|
set(d_ctrls) - set([devops_node]),
|
||||||
[devops_node])
|
[devops_node])
|
||||||
|
|
||||||
# Wait until Nailgun marked suspended controller as offline
|
# Wait until Nailgun marked suspended controller as offline
|
||||||
|
@ -184,10 +189,11 @@ class TestHaFailoverBase(TestBasic):
|
||||||
|
|
||||||
# Wait until MySQL Galera is UP on online controllers
|
# Wait until MySQL Galera is UP on online controllers
|
||||||
self.fuel_web.wait_mysql_galera_is_up(
|
self.fuel_web.wait_mysql_galera_is_up(
|
||||||
[n.name for n in
|
[n.name for n in set(d_ctrls) - set([devops_node])],
|
||||||
set(d_ctrls) - set(devops_node)],
|
|
||||||
timeout=300)
|
timeout=300)
|
||||||
|
|
||||||
|
# STEP: Run OSTF
|
||||||
|
self.show_step([4, 8][num])
|
||||||
self.fuel_web.run_ostf(
|
self.fuel_web.run_ostf(
|
||||||
cluster_id=cluster_id,
|
cluster_id=cluster_id,
|
||||||
test_sets=['ha', 'smoke', 'sanity'],
|
test_sets=['ha', 'smoke', 'sanity'],
|
||||||
|
|
Loading…
Reference in New Issue