make network disruptors skipp if no fencing deployed on overcloud

Change-Id: I62c8c8ed45c0a7d674b0e2aa958ae2e8112e0c55
This commit is contained in:
pinikomarov 2020-06-28 11:41:41 +03:00
parent 4638615388
commit 9303ea8732
2 changed files with 31 additions and 15 deletions

View File

@ -83,17 +83,19 @@ class DisruptTripleoNodesTest(testtools.TestCase):
cloud_disruptions.reset_controllers_non_main_vip() cloud_disruptions.reset_controllers_non_main_vip()
overcloud_health_checks() overcloud_health_checks()
# def test_network_disruptor_main_vip(self): @pacemaker.skip_if_fencing_not_deployed
# overcloud_health_checks() def test_network_disruptor_main_vip(self):
# cloud_disruptions.network_disrupt_controller_main_vip() overcloud_health_checks()
# overcloud_health_checks() cloud_disruptions.network_disrupt_controller_main_vip()
# cloud_disruptions.network_undisrupt_controller_main_vip() overcloud_health_checks()
# cloud_disruptions.network_undisrupt_controller_main_vip()
# def test_network_disruptor_non_main_vip(self):
# overcloud_health_checks() @pacemaker.skip_if_fencing_not_deployed
# cloud_disruptions.network_disrupt_controllers_non_main_vip() def test_network_disruptor_non_main_vip(self):
# overcloud_health_checks() overcloud_health_checks()
# cloud_disruptions.network_undisrupt_controllers_non_main_vip() cloud_disruptions.network_disrupt_controllers_non_main_vip()
overcloud_health_checks()
cloud_disruptions.network_undisrupt_controllers_non_main_vip()
@neutron.skip_if_missing_networking_agents(binary='ovn-controller') @neutron.skip_if_missing_networking_agents(binary='ovn-controller')
def test_reset_ovndb_master_resource(self): def test_reset_ovndb_master_resource(self):

View File

@ -64,7 +64,7 @@ def get_pcs_resources_table():
# prevent pcs table read failure while pacemaker is starting # prevent pcs table read failure while pacemaker is starting
while True: while True:
try: try:
output = sh.execute("sudo pcs status | grep ocf", output = sh.execute("sudo pcs status | grep 'ocf\\|fence'",
ssh_client=ssh_client, ssh_client=ssh_client,
expect_exit_status=None).stdout expect_exit_status=None).stdout
# remove the first column when it only includes '*' characters # remove the first column when it only includes '*' characters
@ -288,9 +288,9 @@ def get_overcloud_resource(resource_type=None,
return pcs_df_query_resource_type['resource'].unique().tolist() return pcs_df_query_resource_type['resource'].unique().tolist()
def instanceha_delpoyed(): def instanceha_deployed():
"""check IHA deployment """check IHA deployment
checks for existance of the nova-evacuate resource""" checks for existence of the nova-evacuate resource"""
if overcloud.has_overcloud(): if overcloud.has_overcloud():
return get_overcloud_nodes_running_pcs_resource( return get_overcloud_nodes_running_pcs_resource(
resource='nova-evacuate') resource='nova-evacuate')
@ -299,4 +299,18 @@ def instanceha_delpoyed():
skip_if_instanceha_not_delpoyed = tobiko.skip_unless( skip_if_instanceha_not_delpoyed = tobiko.skip_unless(
'instanceha not delpoyed', instanceha_delpoyed()) 'instanceha not delpoyed', instanceha_deployed())
def fencing_deployed():
"""check fencing deployment
checks for existence of the stonith-fence type resources"""
if overcloud.has_overcloud():
return get_overcloud_nodes_running_pcs_resource(
resource_type='(stonith:fence_ipmilan):')
else:
return False
skip_if_fencing_not_deployed = tobiko.skip_unless(
'fencing not delpoyed', fencing_deployed())