summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2014-04-25 10:20:06 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-04-25 18:49:26 +0900
commit47856c381cb02b8b07942040aeaf09321e58d490 (patch)
tree0d9ac7767b2016cfede1244a5778c13313963365
parent1d1c3b87518daa35ff8563aaa7207c29dfd512a9 (diff)
tests/integrated: Match on IP dl_type for flows with dec NW TTL actions
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 <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/integrated/test_add_flow_v12_actions.py13
1 files 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 b4cd3116..2f0c7f73 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]