From: YAMAMOTO Takashi Date: Tue, 17 Feb 2015 05:11:11 +0000 (+0900) Subject: OVS UT: Fix some confusions between local vlan id and segmentation id X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b8ab20268cec23aae0b6cb445f201cf4055017be;p=openstack-build%2Fneutron-build.git OVS UT: Fix some confusions between local vlan id and segmentation id Also, use different values for them to expose mistakes. Details: There are two kinds of vlan ids involved here: * local vlan id, which is managed by each agents in a node-local manner. * segmentation id, which is managed by the corresponding ML2 type driver. These tests use the distinct variables for them. (LV_ID and LS_ID respectively) However, these variables are misused in some places, relying on the fact that their values are same. (42) Change-Id: Ib2ba74be74c2c361d25821acab2083a17b1b0173 --- diff --git a/neutron/tests/unit/openvswitch/test_ovs_tunnel.py b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py index 53595cbd6..5b7eb0f28 100644 --- a/neutron/tests/unit/openvswitch/test_ovs_tunnel.py +++ b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py @@ -31,7 +31,7 @@ from neutron.tests import base # Useful global dummy variables. NET_UUID = '3faeebfe-5d37-11e1-a64b-000c29d5f0a7' -LS_ID = 42 +LS_ID = 420 LV_ID = 42 LV_IDS = [42, 43] VIF_ID = '404deaec-5d37-11e1-a64b-000c29d5f0a8' @@ -367,10 +367,10 @@ class TunnelTest(base.BaseTestCase): mock.call.add_flow(priority=4, in_port=self.MAP_TUN_PHY_OFPORT, dl_vlan=LV_ID, actions=action_string)) - action_string = 'mod_vlan_vid:%s,normal' % LS_ID + action_string = 'mod_vlan_vid:%s,normal' % LV_ID self.mock_int_bridge_expected.append( mock.call.add_flow(priority=3, in_port=self.INT_OFPORT, - dl_vlan=LV_ID, actions=action_string)) + dl_vlan=LS_ID, actions=action_string)) a = self._build_agent() a.available_local_vlans = set([LV_ID]) @@ -424,7 +424,7 @@ class TunnelTest(base.BaseTestCase): in_port=self.MAP_TUN_PHY_OFPORT, dl_vlan=LVM_VLAN.vlan)) self.mock_int_bridge_expected.append( mock.call.delete_flows( - dl_vlan=LV_ID, in_port=self.INT_OFPORT)) + dl_vlan=LS_ID, in_port=self.INT_OFPORT)) a = self._build_agent() a.phys_brs['net1'] = self.mock_map_tun_bridge