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
This commit is contained in:
Assaf Muller 2015-06-11 17:13:44 -04:00 committed by Ihar Hrachyshka
parent a885c4075a
commit bcafe20a14
5 changed files with 26 additions and 9 deletions

View File

@ -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+

View File

@ -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(),

View File

@ -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):

View File

@ -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)

View File

@ -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)