Merge "Make functional Neutron tests running fine on ML2/OVN environments"
This commit is contained in:
commit
4f35836798
@ -335,6 +335,8 @@ class NetworkTests(common.NetworkTagTests):
|
||||
def test_network_dhcp_agent(self):
|
||||
if not self.haz_network:
|
||||
self.skipTest("No Network service present")
|
||||
if not self.is_extension_enabled("dhcp_agent_scheduler"):
|
||||
self.skipTest("No dhcp_agent_scheduler extension present")
|
||||
|
||||
name1 = uuid.uuid4().hex
|
||||
cmd_output1 = json.loads(self.openstack(
|
||||
|
@ -49,6 +49,11 @@ class NetworkAgentTests(common.NetworkTests):
|
||||
cmd_output['id'],
|
||||
)
|
||||
|
||||
if 'ovn' in agent_list[0]['Agent Type'].lower():
|
||||
# NOTE(slaweq): OVN Neutron agents can't be updated so test can be
|
||||
# finished here
|
||||
return
|
||||
|
||||
# agent set
|
||||
raw_output = self.openstack(
|
||||
'network agent set --disable %s' % agent_ids[0]
|
||||
@ -89,6 +94,9 @@ class NetworkAgentListTests(common.NetworkTests):
|
||||
def test_network_dhcp_agent_list(self):
|
||||
"""Test network agent list"""
|
||||
|
||||
if not self.is_extension_enabled("dhcp_agent_scheduler"):
|
||||
self.skipTest("No dhcp_agent_scheduler extension present")
|
||||
|
||||
name1 = uuid.uuid4().hex
|
||||
cmd_output1 = json.loads(self.openstack(
|
||||
'network create -f json --description aaaa %s' % name1
|
||||
@ -131,6 +139,10 @@ class NetworkAgentListTests(common.NetworkTests):
|
||||
|
||||
def test_network_agent_list_routers(self):
|
||||
"""Add agent to router, list agents on router, delete."""
|
||||
|
||||
if not self.is_extension_enabled("l3_agent_scheduler"):
|
||||
self.skipTest("No l3_agent_scheduler extension present")
|
||||
|
||||
name = uuid.uuid4().hex
|
||||
cmd_output = json.loads(self.openstack(
|
||||
'router create -f json %s' % name))
|
||||
|
@ -26,6 +26,14 @@ class TestNetworkServiceProvider(common.NetworkTests):
|
||||
# Nothing in this class works with Nova Network
|
||||
if not self.haz_network:
|
||||
self.skipTest("No Network service present")
|
||||
# NOTE(slaweq):
|
||||
# that tests should works only when "standard" Neutron L3 agent is
|
||||
# used, as e.g. OVN L3 plugin don't supports that.
|
||||
l3_agent_list = json.loads(self.openstack(
|
||||
'network agent list -f json --agent-type l3 -c ID'
|
||||
))
|
||||
if not l3_agent_list:
|
||||
self.skipTest("No Neutron L3 Agents present")
|
||||
|
||||
def test_network_service_provider_list(self):
|
||||
cmd_output = json.loads(self.openstack(
|
||||
|
@ -155,6 +155,10 @@ class RouterTests(common.NetworkTagTests):
|
||||
|
||||
def test_router_list_l3_agent(self):
|
||||
"""Tests create router, add l3 agent, list, delete"""
|
||||
|
||||
if not self.is_extension_enabled("l3_agent_scheduler"):
|
||||
self.skipTest("No l3_agent_scheduler extension present")
|
||||
|
||||
name = uuid.uuid4().hex
|
||||
cmd_output = json.loads(self.openstack(
|
||||
'router create -f json ' + name))
|
||||
@ -235,20 +239,7 @@ class RouterTests(common.NetworkTagTests):
|
||||
)
|
||||
|
||||
# Test set --ha --distributed
|
||||
cmd_output = self.openstack(
|
||||
'router set ' +
|
||||
'--distributed ' +
|
||||
'--external-gateway public ' +
|
||||
new_name
|
||||
)
|
||||
self.assertOutput('', cmd_output)
|
||||
|
||||
cmd_output = json.loads(self.openstack(
|
||||
'router show -f json ' +
|
||||
new_name
|
||||
))
|
||||
self.assertTrue(cmd_output["distributed"])
|
||||
self.assertIsNotNone(cmd_output["external_gateway_info"])
|
||||
self._test_set_router_distributed(new_name)
|
||||
|
||||
# Test unset
|
||||
cmd_output = self.openstack(
|
||||
@ -262,6 +253,25 @@ class RouterTests(common.NetworkTagTests):
|
||||
))
|
||||
self.assertIsNone(cmd_output["external_gateway_info"])
|
||||
|
||||
def _test_set_router_distributed(self, router_name):
|
||||
if not self.is_extension_enabled("dvr"):
|
||||
return
|
||||
|
||||
cmd_output = self.openstack(
|
||||
'router set ' +
|
||||
'--distributed ' +
|
||||
'--external-gateway public ' +
|
||||
router_name
|
||||
)
|
||||
self.assertOutput('', cmd_output)
|
||||
|
||||
cmd_output = json.loads(self.openstack(
|
||||
'router show -f json ' +
|
||||
router_name
|
||||
))
|
||||
self.assertTrue(cmd_output["distributed"])
|
||||
self.assertIsNotNone(cmd_output["external_gateway_info"])
|
||||
|
||||
def test_router_add_remove_route(self):
|
||||
network_name = uuid.uuid4().hex
|
||||
subnet_name = uuid.uuid4().hex
|
||||
|
Loading…
x
Reference in New Issue
Block a user