From bcafe20a14048b90d1f3153dad6076e42bf571f5 Mon Sep 17 00:00:00 2001 From: Assaf Muller Date: Thu, 11 Jun 2015 17:13:44 -0400 Subject: [PATCH] Add l2pop support to full stack tests Add the l2pop mechanism driver to the ML2 plugin configuration, and set l2_population = True, in the OVS agent configuration. Each test class can enable or disable l2pop in its environment. Change-Id: If4f2bf07883b763073b5a53f1aa557acb131d176 --- doc/source/devref/fullstack_testing.rst | 1 + neutron/tests/fullstack/resources/config.py | 13 ++++++++++--- neutron/tests/fullstack/resources/environment.py | 3 ++- neutron/tests/fullstack/test_connectivity.py | 12 +++++++++--- neutron/tests/fullstack/test_l3_agent.py | 6 ++++-- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/doc/source/devref/fullstack_testing.rst b/doc/source/devref/fullstack_testing.rst index 5467f74f4..4256bae66 100644 --- a/doc/source/devref/fullstack_testing.rst +++ b/doc/source/devref/fullstack_testing.rst @@ -119,3 +119,4 @@ Long Term Goals mechanism driver. We may modularize the topology configuration further to allow to rerun full stack tests against different Neutron plugins or ML2 mechanism drivers. +* Add OVS ARP responder coverage when the gate supports OVS 2.1+ diff --git a/neutron/tests/fullstack/resources/config.py b/neutron/tests/fullstack/resources/config.py index 215f4909d..c39ed2bc5 100644 --- a/neutron/tests/fullstack/resources/config.py +++ b/neutron/tests/fullstack/resources/config.py @@ -159,10 +159,14 @@ class ML2ConfigFixture(ConfigFixture): super(ML2ConfigFixture, self).__init__( env_desc, host_desc, temp_dir, base_filename='ml2_conf.ini') + mechanism_drivers = 'openvswitch' + if self.env_desc.l2_pop: + mechanism_drivers += ',l2population' + self.config.update({ 'ml2': { 'tenant_network_types': tenant_network_types, - 'mechanism_drivers': 'openvswitch', + 'mechanism_drivers': mechanism_drivers, }, 'ml2_type_vlan': { 'network_vlan_ranges': 'physnet1:1000:2999', @@ -193,12 +197,15 @@ class OVSConfigFixture(ConfigFixture): 'securitygroup': { 'firewall_driver': ('neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver'), + }, + 'agent': { + 'l2_population': str(self.env_desc.l2_pop), } }) if self.tunneling_enabled: - self.config['agent'] = { - 'tunnel_types': self.env_desc.network_type} + self.config['agent'].update({ + 'tunnel_types': self.env_desc.network_type}) self.config['ovs'].update({ 'tunnel_bridge': self._generate_tunnel_bridge(), 'int_peer_patch_port': self._generate_int_peer(), diff --git a/neutron/tests/fullstack/resources/environment.py b/neutron/tests/fullstack/resources/environment.py index 7a0d67e6a..152b7a447 100644 --- a/neutron/tests/fullstack/resources/environment.py +++ b/neutron/tests/fullstack/resources/environment.py @@ -34,8 +34,9 @@ class EnvironmentDescription(object): Does the setup, as a whole, support tunneling? How about l2pop? """ - def __init__(self, network_type='vxlan'): + def __init__(self, network_type='vxlan', l2_pop=True): self.network_type = network_type + self.l2_pop = l2_pop @property def tunneling_enabled(self): diff --git a/neutron/tests/fullstack/test_connectivity.py b/neutron/tests/fullstack/test_connectivity.py index ed72221b5..5137fa310 100644 --- a/neutron/tests/fullstack/test_connectivity.py +++ b/neutron/tests/fullstack/test_connectivity.py @@ -26,15 +26,21 @@ load_tests = testscenarios.load_tests_apply_scenarios class TestConnectivitySameNetwork(base.BaseFullStackTestCase): - scenarios = [('VXLAN', {'network_type': 'vxlan'}), - ('VLANs', {'network_type': 'vlan'})] + scenarios = [ + ('VXLAN', {'network_type': 'vxlan', + 'l2_pop': False}), + ('GRE and l2pop', {'network_type': 'gre', + 'l2_pop': True}), + ('VLANs', {'network_type': 'vlan', + 'l2_pop': False})] def setUp(self): host_descriptions = [ environment.HostDescription() for _ in range(2)] env = environment.Environment( environment.EnvironmentDescription( - network_type=self.network_type), + network_type=self.network_type, + l2_pop=self.l2_pop), host_descriptions) super(TestConnectivitySameNetwork, self).setUp(env) diff --git a/neutron/tests/fullstack/test_l3_agent.py b/neutron/tests/fullstack/test_l3_agent.py index 2a0814fff..64bea3000 100644 --- a/neutron/tests/fullstack/test_l3_agent.py +++ b/neutron/tests/fullstack/test_l3_agent.py @@ -29,7 +29,8 @@ class TestLegacyL3Agent(base.BaseFullStackTestCase): def setUp(self): host_descriptions = [environment.HostDescription(l3_agent=True)] env = environment.Environment( - environment.EnvironmentDescription(network_type='vlan'), + environment.EnvironmentDescription( + network_type='vlan', l2_pop=False), host_descriptions) super(TestLegacyL3Agent, self).setUp(env) @@ -61,7 +62,8 @@ class TestHAL3Agent(base.BaseFullStackTestCase): host_descriptions = [ environment.HostDescription(l3_agent=True) for _ in range(2)] env = environment.Environment( - environment.EnvironmentDescription(network_type='vxlan'), + environment.EnvironmentDescription( + network_type='vxlan', l2_pop=True), host_descriptions) super(TestHAL3Agent, self).setUp(env) -- 2.45.2