Merge "Fix AZ tests skipping code for podified"

This commit is contained in:
Zuul 2024-04-15 20:44:02 +00:00 committed by Gerrit Code Review
commit b74274bd67
3 changed files with 8 additions and 7 deletions

View File

@ -72,7 +72,6 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase):
cls.master_node_client = cls.get_node_client('localhost') cls.master_node_client = cls.get_node_client('localhost')
cls.master_cont_cmd_executor = cls.run_on_master_controller cls.master_cont_cmd_executor = cls.run_on_master_controller
cls.neutron_api_prefix = '' cls.neutron_api_prefix = ''
cls.neutron_conf = WB_CONF.neutron_config
elif WB_CONF.openstack_type == 'podified': elif WB_CONF.openstack_type == 'podified':
cls.proxy_host_client = cls.get_node_client( cls.proxy_host_client = cls.get_node_client(
host=WB_CONF.proxy_host_address, host=WB_CONF.proxy_host_address,
@ -83,7 +82,9 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase):
"ln -s {} /home/{}/.kube/config || true".format( "ln -s {} /home/{}/.kube/config || true".format(
WB_CONF.kubeconfig_path, WB_CONF.proxy_host_user)) WB_CONF.kubeconfig_path, WB_CONF.proxy_host_user))
cls.master_node_client = cls.proxy_host_client cls.master_node_client = cls.proxy_host_client
cls.master_cont_cmd_executor = cls.proxy_host_client cls.master_cont_cmd_executor = cls.proxy_host_client.exec_command
cls.neutron_api_prefix = 'oc rsh {} '.format(
cls.get_pod_of_service())
else: else:
LOG.warning(("Unrecognized deployer tool '{}', plugin supports " LOG.warning(("Unrecognized deployer tool '{}', plugin supports "
"openstack_type as devstack/podified.".format( "openstack_type as devstack/podified.".format(

View File

@ -35,13 +35,13 @@ class OvsAvaliabilityzonesTest(base.BaseTempestWhiteboxTestCase):
@classmethod @classmethod
def resource_setup(cls): def resource_setup(cls):
super(OvsAvaliabilityzonesTest, cls).resource_setup() super(OvsAvaliabilityzonesTest, cls).resource_setup()
if cls.has_ovn_support:
raise cls.skipException(
"These availability zone tests are supported on OVS only.")
cls.client = cls.os_adm.network_client cls.client = cls.os_adm.network_client
cls.get_neutron_agent_availability_zones() cls.get_neutron_agent_availability_zones()
if not cls.AZs_list: if not cls.AZs_list:
raise cls.skipException("No availability zones configured") raise cls.skipException("No availability zones configured")
if cls.has_ovn_support:
raise cls.skipException(
"These availability zone tests are supported on OVS only.")
@classmethod @classmethod
def get_neutron_agent_availability_zones(cls): def get_neutron_agent_availability_zones(cls):
@ -65,7 +65,7 @@ class OvsAvaliabilityzonesTest(base.BaseTempestWhiteboxTestCase):
else: else:
cls.dhcp_agent_list[agent.get('host')] = az cls.dhcp_agent_list[agent.get('host')] = az
cmd = '{} crudini --get {} DEFAULT {{}} || echo'.format( cmd = '{} crudini --get {} DEFAULT {{}} || echo'.format(
cls.neutron_api_prefix, cls.neutron_conf) cls.neutron_api_prefix, WB_CONF.neutron_config)
def integer(int_var): def integer(int_var):
try: try:

View File

@ -62,7 +62,7 @@ class OvnAvaliabilityzonesTest(
cls.ovn_controller_gw_agent_list[ cls.ovn_controller_gw_agent_list[
agent.get('host').replace('"', '').split('.')[0]] = az agent.get('host').replace('"', '').split('.')[0]] = az
cmd = '{} crudini --get {} DEFAULT {{}} || echo'.format( cmd = '{} crudini --get {} DEFAULT {{}} || echo'.format(
cls.neutron_api_prefix, cls.neutron_conf) cls.neutron_api_prefix, WB_CONF.neutron_config)
def array(list_var): def array(list_var):
return_list = list_var.strip().split(',') return_list = list_var.strip().split(',')