]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Don't set priority when calling mod_flow
authorKyle Mestery <kmestery@cisco.com>
Fri, 21 Mar 2014 09:41:31 +0000 (09:41 +0000)
committerKyle Mestery <kmestery@cisco.com>
Fri, 21 Mar 2014 09:44:34 +0000 (09:44 +0000)
This commit [1] changed the behavior of modifying flows to not allow priority
to be set on flow modification. The agent code which was calling mod_flow was
not updated to respect this behavior. The unit tests were also not updated in
this regard. I've corrected this behavior now, and added a negative UT case to
catch this in the future.

[1] https://review.openstack.org/#/c/58533/

Closes-Bug: #1295703

Change-Id: I20737637cc84567a5ec19efaad18e7f334007f18

neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_lib.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_tunnel.py

index b072c2659baa8cebc3a97c7354b2155f82bda930..3081f8798820851978e6a54f246212a4295d8be3 100644 (file)
@@ -371,7 +371,6 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
             lvm.tun_ofports.add(ofport)
             ofports = ','.join(lvm.tun_ofports)
             self.tun_br.mod_flow(table=constants.FLOOD_TO_TUN,
-                                 priority=1,
                                  dl_vlan=lvm.vlan,
                                  actions="strip_vlan,set_tunnel:%s,"
                                  "output:%s" % (lvm.segmentation_id, ofports))
@@ -390,7 +389,6 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
             if len(lvm.tun_ofports) > 0:
                 ofports = ','.join(lvm.tun_ofports)
                 self.tun_br.mod_flow(table=constants.FLOOD_TO_TUN,
-                                     priority=1,
                                      dl_vlan=lvm.vlan,
                                      actions="strip_vlan,"
                                      "set_tunnel:%s,output:%s" %
@@ -452,7 +450,6 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
                 ofports = ','.join(self.tun_br_ofports[network_type].values())
                 if ofports:
                     self.tun_br.mod_flow(table=constants.FLOOD_TO_TUN,
-                                         priority=1,
                                          dl_vlan=lvid,
                                          actions="strip_vlan,"
                                          "set_tunnel:%s,output:%s" %
@@ -927,7 +924,6 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
             for network_id, vlan_mapping in self.local_vlan_map.iteritems():
                 if vlan_mapping.network_type == tunnel_type:
                     self.tun_br.mod_flow(table=constants.FLOOD_TO_TUN,
-                                         priority=1,
                                          dl_vlan=vlan_mapping.vlan,
                                          actions="strip_vlan,"
                                          "set_tunnel:%s,output:%s" %
index fccd341718316e4b274cb50035b9ef1ceaaade06..56a085972b1ff1b59d8a20e6839ac7d605ef261d 100644 (file)
@@ -359,6 +359,14 @@ class OVS_Lib_Test(base.BaseTestCase):
                           self.br.delete_flows,
                           **params)
 
+    def test_mod_flow_with_priority_set(self):
+        params = {'in_port': '1',
+                  'priority': '1'}
+
+        self.assertRaises(exceptions.InvalidInput,
+                          self.br.mod_flow,
+                          **params)
+
     def test_mod_flow_no_actions_set(self):
         params = {'in_port': '1'}
 
index dc6723cf646e6880d99db1f9b64af288b25afcdf..b2415a6d5959ae9b45a638ce275205e8fe216a9a 100644 (file)
@@ -602,7 +602,6 @@ class TestOvsNeutronAgent(base.BaseTestCase):
                                            actions='strip_vlan,'
                                            'set_tunnel:seg1,output:2')
             mod_flow_fn.assert_called_with(table=constants.FLOOD_TO_TUN,
-                                           priority=1,
                                            dl_vlan='vlan1',
                                            actions='strip_vlan,'
                                            'set_tunnel:seg1,output:1,2')
@@ -625,7 +624,6 @@ class TestOvsNeutronAgent(base.BaseTestCase):
                                            dl_vlan='vlan2',
                                            dl_dst='mac')
             mod_flow_fn.assert_called_with(table=constants.FLOOD_TO_TUN,
-                                           priority=1,
                                            dl_vlan='vlan2',
                                            actions='strip_vlan,'
                                            'set_tunnel:seg2,output:1')
index 8de601a047adb2fccdfbd2c707a575487ed4dab3..fa1b11017fe83c06b4527daf13b64f87912a81cb 100644 (file)
@@ -262,7 +262,6 @@ class TunnelTest(base.BaseTestCase):
         ofports = ','.join(TUN_OFPORTS[p_const.TYPE_GRE].values())
         self.mock_tun_bridge_expected += [
             mock.call.mod_flow(table=constants.FLOOD_TO_TUN,
-                               priority=1,
                                dl_vlan=LV_ID,
                                actions="strip_vlan,"
                                "set_tunnel:%s,output:%s" %