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 the dec NW TTL action is inconsistent if
it the flow does not match on the IPv4 or IPv6 dl_type because
the action manipulates either the IPv4 TTL or the IPv6 hop limit.

This patch splits the testing of the dec NW TTL action into two tests,
one for each of IPv4 and IPv6, including a match on the corresponding
dl_type in the flow.

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

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

diff --git a/ryu/tests/integrated/test_add_flow_v12_actions.py 
b/ryu/tests/integrated/test_add_flow_v12_actions.py
index b4cd311..2f0c7f7 100644
--- a/ryu/tests/integrated/test_add_flow_v12_actions.py
+++ b/ryu/tests/integrated/test_add_flow_v12_actions.py
@@ -421,10 +421,19 @@ class RunTest(tester.TestFlowBase):
         actions = [dp.ofproto_parser.OFPActionSetNwTtl(nw_ttl), ]
         self.add_apply_actions(dp, actions)
 
-    def test_action_dec_nw_ttl(self, dp):
+    def test_action_dec_nw_ttl_ipv4(self, dp):
         self._verify = [dp.ofproto.OFPAT_DEC_NW_TTL]
         actions = [dp.ofproto_parser.OFPActionDecNwTtl(), ]
-        self.add_apply_actions(dp, actions)
+        match = dp.ofproto_parser.OFPMatch()
+        match.set_dl_type(0x0800)
+        self.add_apply_actions(dp, actions, match)
+
+    def test_action_dec_nw_ttl_ipv6(self, dp):
+        self._verify = [dp.ofproto.OFPAT_DEC_NW_TTL]
+        actions = [dp.ofproto_parser.OFPActionDecNwTtl(), ]
+        match = dp.ofproto_parser.OFPMatch()
+        match.set_dl_type(0x86dd)
+        self.add_apply_actions(dp, actions, match)
 
     def test_action_copy_ttl_out(self, dp):
         self._verify = [dp.ofproto.OFPAT_COPY_TTL_OUT]
-- 
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