diff options
author | Simon Horman <horms@verge.net.au> | 2014-04-25 10:20:13 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-04-25 18:49:33 +0900 |
commit | 55ec423e25ce0de813b1e662bbb2fdc49ed7b92f (patch) | |
tree | de06d719f1a722de4f0559694311d3dbe1b468e3 | |
parent | f6e1fa4c57fa7011838129db0e09755510b89b4b (diff) |
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 <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.py | 12 |
1 files 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: |