]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
OVS UT: Fix some confusions between local vlan id and segmentation id
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Tue, 17 Feb 2015 05:11:11 +0000 (14:11 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 18 Feb 2015 01:48:50 +0000 (01:48 +0000)
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

neutron/tests/unit/openvswitch/test_ovs_tunnel.py

index 53595cbd6b890fb490a833a64fe8bd40c1124fbf..5b7eb0f2824f41cac53de9947f49da39d1bf8007 100644 (file)
@@ -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