OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.

In terms of the above MPLS TTL actions are inconsistent if the flow
does not match on one of the MPLS dl_types.

This patch add such a match for the flows that have MPLS TTL actions.

Also enable these tests, they appear to be supported by Open vSwitch.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.

Signed-off-by: Simon Horman <[email protected]>
---
 ryu/tests/integrated/test_add_flow_v12_actions.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/ryu/tests/integrated/test_add_flow_v12_actions.py 
b/ryu/tests/integrated/test_add_flow_v12_actions.py
index 757c5e3..2c29f45 100644
--- a/ryu/tests/integrated/test_add_flow_v12_actions.py
+++ b/ryu/tests/integrated/test_add_flow_v12_actions.py
@@ -420,12 +420,16 @@ class RunTest(tester.TestFlowBase):
         self._verify = [dp.ofproto.OFPAT_SET_MPLS_TTL,
                         'mpls_ttl', mpls_ttl]
         actions = [dp.ofproto_parser.OFPActionSetMplsTtl(mpls_ttl), ]
-        self.add_apply_actions(dp, actions)
+        match = dp.ofproto_parser.OFPMatch()
+        match.set_dl_type(ether.ETH_TYPE_MPLS)
+        self.add_apply_actions(dp, actions, match)
 
     def test_action_dec_mpls_ttl(self, dp):
         self._verify = [dp.ofproto.OFPAT_DEC_MPLS_TTL]
         actions = [dp.ofproto_parser.OFPActionDecMplsTtl(), ]
-        self.add_apply_actions(dp, actions)
+        match = dp.ofproto_parser.OFPMatch()
+        match.set_dl_type(ether.ETH_TYPE_MPLS)
+        self.add_apply_actions(dp, actions, match)
 
     def test_action_set_nw_ttl_ipv4(self, dp):
         nw_ttl = 64
@@ -483,11 +487,9 @@ class RunTest(tester.TestFlowBase):
             'test_action_set_field_ipv6_nd_tll',
             'test_action_copy_ttl_in',
             'test_action_copy_ttl_out',
-            'test_action_dec_mpls_ttl',
             'test_action_push_mpls',
             'test_action_set_field_mpls_label',
-            'test_action_set_field_mpls_tc',
-            'test_action_set_mpls_ttl'
+            'test_action_set_field_mpls_tc'
         ]
         for u in unsupported:
             if t.find(u) != -1:
-- 
1.8.5.2


------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to