add 4094 to fix the range of available local vlans
in fact the range of available local vlan is 1-4094, but when initialization of the local vlan in ovs_neutron_agent, self.available_local_vlans is set([1,2,3...4093]),omit 4094 This causes a problem that ovs-agent will not use 4094 as local vlan modify moves.range(p_const.MIN_VLAN_TAG, p_const.MAX_VLAN_TAG+1) Closes-Bug: #1668908 Change-Id: Ic25929cad89ab2e31fdf5b70875b84491dfc52ed
This commit is contained in:
parent
97db8aab07
commit
ae8e6095f9
neutron
plugins/ml2/drivers/openvswitch/agent
tests/unit/plugins/ml2/drivers/openvswitch/agent
@ -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
|
||||
|
14
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py
Normal file → Executable file
14
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py
Normal file → Executable 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'),\
|
||||
|
Loading…
x
Reference in New Issue
Block a user