Merge "add 4094 to fix the range of available local vlans"

This commit is contained in:
Jenkins 2017-03-21 00:09:07 +00:00 committed by Gerrit Code Review
commit cd947ac4d0
2 changed files with 15 additions and 1 deletions

View File

@ -149,7 +149,7 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
self.use_veth_interconnection = ovs_conf.use_veth_interconnection
self.veth_mtu = agent_conf.veth_mtu
self.available_local_vlans = set(moves.range(p_const.MIN_VLAN_TAG,
p_const.MAX_VLAN_TAG))
p_const.MAX_VLAN_TAG + 1))
self.tunnel_types = agent_conf.tunnel_types or []
self.l2_pop = agent_conf.l2_population
# TODO(ethuleau): Change ARP responder so it's not dependent on the

View File

@ -211,6 +211,20 @@ class TestOvsNeutronAgent(object):
self.assertEqual(expected,
self.agent.agent_state['agent_type'])
def test_agent_available_local_vlans(self):
expected = [p_const.MIN_VLAN_TAG,
p_const.MIN_VLAN_TAG + 1,
p_const.MAX_VLAN_TAG - 1,
p_const.MAX_VLAN_TAG]
exception = [p_const.MIN_VLAN_TAG - 1,
p_const.MAX_VLAN_TAG + 1,
p_const.MAX_VLAN_TAG + 2]
available_vlan = self.agent.available_local_vlans
for tag in expected:
self.assertIn(tag, available_vlan)
for tag in exception:
self.assertNotIn(tag, available_vlan)
def test_agent_type_alt(self):
with mock.patch.object(self.mod_agent.OVSNeutronAgent,
'setup_integration_br'),\