From b8a80b0151974d7768d28ff371c336633b1f4226 Mon Sep 17 00:00:00 2001 From: Julia Marciano Date: Sun, 14 Feb 2021 22:28:23 +0200 Subject: [PATCH] Crash controllers that don't hold an overcloud main VIP. Change-Id: Ib909de04d20bec8f816f9c415ad69ece61ed8669 --- tobiko/tests/faults/ha/cloud_disruptions.py | 9 +++++++-- tobiko/tests/faults/ha/test_cloud_recovery.py | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tobiko/tests/faults/ha/cloud_disruptions.py b/tobiko/tests/faults/ha/cloud_disruptions.py index a8546b5a0..883e2531a 100644 --- a/tobiko/tests/faults/ha/cloud_disruptions.py +++ b/tobiko/tests/faults/ha/cloud_disruptions.py @@ -149,7 +149,7 @@ def disrupt_all_controller_nodes(disrupt_method=sh.hard_reset_method, nodes = [node for node in nodes if node.name not in exclude_list] for controller in nodes: - if disrupt_method in (sh.hard_reset_method, sh.soft_reset_method): + if isinstance(disrupt_method, sh.RebootHostMethod): reboot_node(controller.name, wait=sequentially, reboot_method=disrupt_method) else: @@ -228,7 +228,7 @@ def disrupt_controller_main_vip(disrupt_method=sh.hard_reset_method, main_vip_controller = get_main_vip_controller(main_vip) - if disrupt_method in (sh.hard_reset_method, sh.soft_reset_method): + if isinstance(disrupt_method, sh.RebootHostMethod): if inverse: reboot_all_controller_nodes(reboot_method=disrupt_method, exclude_list=[main_vip_controller]) @@ -257,6 +257,11 @@ def crash_controller_main_vip(): disrupt_controller_main_vip(disrupt_method=sh.crash_method) +def crash_controllers_non_main_vip(): + disrupt_controller_main_vip(disrupt_method=sh.crash_method, + inverse=True) + + def network_disrupt_controller_main_vip(): disrupt_controller_main_vip(disrupt_method=network_disruption) LOG.info('waiting 60s to avoid race conditions...') diff --git a/tobiko/tests/faults/ha/test_cloud_recovery.py b/tobiko/tests/faults/ha/test_cloud_recovery.py index 3b4c3f6c5..6095e7b3f 100644 --- a/tobiko/tests/faults/ha/test_cloud_recovery.py +++ b/tobiko/tests/faults/ha/test_cloud_recovery.py @@ -104,6 +104,11 @@ class DisruptTripleoNodesTest(testtools.TestCase): cloud_disruptions.crash_controller_main_vip() overcloud_health_checks() + def test_crash_controller_non_main_vip(self): + overcloud_health_checks() + cloud_disruptions.crash_controllers_non_main_vip() + overcloud_health_checks() + @pacemaker.skip_if_fencing_not_deployed def test_network_disruptor_main_vip(self): overcloud_health_checks()