From 55ec423e25ce0de813b1e662bbb2fdc49ed7b92f Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 25 Apr 2014 10:20:13 +0900 Subject: [PATCH] tests/integrated: Match on MPLS dl_type for flows with MPLS 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 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 Signed-off-by: FUJITA Tomonori --- 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 757c5e36..2c29f459 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: