Add skip funtion for checking enabled extensions in the l3 agent
This function check the extension configured in the l3 network agent and if the extension is no enabled the test is skipped That validation should not be applied when the l3 agent does not exist, e.g.: OVN configurations Change-Id: Icbc379d6b8ab0d720d2ae242d79949fb4dd9d27c
This commit is contained in:
parent
63e1543d62
commit
e6b1004ff2
@ -207,6 +207,21 @@ class BaseTempestTestCase(base_api.BaseNetworkTest):
|
||||
LOG.debug("Created router %s", router['name'])
|
||||
return router
|
||||
|
||||
@classmethod
|
||||
def skip_if_no_extension_enabled_in_l3_agents(cls, extension):
|
||||
l3_agents = cls.os_admin.network_client.list_agents(
|
||||
binary='neutron-l3-agent')['agents']
|
||||
if not l3_agents:
|
||||
# the tests should not be skipped when neutron-l3-agent does not
|
||||
# exist (this validation doesn't apply to the setups like
|
||||
# e.g. ML2/OVN)
|
||||
return
|
||||
for agent in l3_agents:
|
||||
if extension in agent['configurations'].get('extensions', []):
|
||||
return
|
||||
raise cls.skipTest("No L3 agent with '%s' extension enabled found." %
|
||||
extension)
|
||||
|
||||
@removals.remove(version='Stein',
|
||||
message="Please use create_floatingip method instead of "
|
||||
"create_and_associate_floatingip.")
|
||||
|
@ -341,15 +341,6 @@ class FloatingIPQosTest(FloatingIpTestCasesMixin,
|
||||
def resource_setup(cls):
|
||||
super(FloatingIPQosTest, cls).resource_setup()
|
||||
|
||||
def skip_if_no_extension_enabled_in_l3_agents(self, extension):
|
||||
l3_agents = self.os_admin.network_client.list_agents(
|
||||
binary='neutron-l3-agent')['agents']
|
||||
for agent in l3_agents:
|
||||
if extension in agent['configurations'].get('extensions', []):
|
||||
return
|
||||
raise self.skipTest("No L3 agent with '%s' extension enabled found." %
|
||||
extension)
|
||||
|
||||
@decorators.idempotent_id('5eb48aea-eaba-4c20-8a6f-7740070a0aa3')
|
||||
def test_qos(self):
|
||||
"""Test floating IP is binding to a QoS policy with
|
||||
|
@ -31,11 +31,13 @@ LOG = log.getLogger(__name__)
|
||||
|
||||
class PortForwardingTestJSON(base.BaseTempestTestCase):
|
||||
|
||||
credentials = ['primary', 'admin']
|
||||
required_extensions = ['router', 'floating-ip-port-forwarding']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(PortForwardingTestJSON, cls).resource_setup()
|
||||
cls.skip_if_no_extension_enabled_in_l3_agents("port_forwarding")
|
||||
cls.network = cls.create_network()
|
||||
cls.subnet = cls.create_subnet(cls.network)
|
||||
cls.router = cls.create_router_by_client()
|
||||
|
Loading…
x
Reference in New Issue
Block a user