From 57ead07a90c8093035ef88d7886411f2d098de90 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 4 Sep 2024 10:33:27 +0000 Subject: [PATCH] Method to return the Neutron API service name Closes-Bug: #OSPRH-9825 Change-Id: I45e941873a640ea75a2a1db0e68fc6abc767e32e --- whitebox_neutron_tempest_plugin/common/utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/whitebox_neutron_tempest_plugin/common/utils.py b/whitebox_neutron_tempest_plugin/common/utils.py index 6ccca07..6c4cd10 100644 --- a/whitebox_neutron_tempest_plugin/common/utils.py +++ b/whitebox_neutron_tempest_plugin/common/utils.py @@ -28,6 +28,7 @@ from whitebox_neutron_tempest_plugin.common import constants CONF = config.CONF LOG = log.getLogger(__name__) +WB_CONF = CONF.whitebox_neutron_plugin_options def create_payload_file(ssh_client, size): @@ -290,3 +291,13 @@ def wait_for_neutron_api(neutron_client, timeout=100): return False common_utils.wait_until_true(_list_agents, timeout=timeout, sleep=1) + + +def get_neutron_api_service_name(): + """Return the Neutron API service name based on the test configuration""" + if WB_CONF.openstack_type == 'devstack': + # NOTE: in OSP18+, the Neutron API will use WSGI by default (not the + # eventlet server) and the name will be "neutron api" + return 'q svc' + else: + return 'neutron api'