tests/integrated: Match on IP dl_type for flows with set 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 set 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 set NW TTL action into two tests,
one for each of IPv4 and IPv6, including a match on the corresponding
dl_type in the flow.

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>
This commit is contained in:
Simon Horman 2014-04-25 10:20:09 +09:00 committed by FUJITA Tomonori
parent ec02de8d7a
commit d5e433ee04

View File

@ -419,12 +419,23 @@ class RunTest(tester.TestFlowBase):
actions = [dp.ofproto_parser.OFPActionDecMplsTtl(), ]
self.add_apply_actions(dp, actions)
def test_action_set_nw_ttl(self, dp):
def test_action_set_nw_ttl_ipv4(self, dp):
nw_ttl = 64
self._verify = [dp.ofproto.OFPAT_SET_NW_TTL,
'nw_ttl', nw_ttl]
actions = [dp.ofproto_parser.OFPActionSetNwTtl(nw_ttl), ]
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_set_nw_ttl_ipv6(self, dp):
nw_ttl = 64
self._verify = [dp.ofproto.OFPAT_SET_NW_TTL,
'nw_ttl', nw_ttl]
actions = [dp.ofproto_parser.OFPActionSetNwTtl(nw_ttl), ]
match = dp.ofproto_parser.OFPMatch()
match.set_dl_type(0x86dd)
self.add_apply_actions(dp, actions, match)
def test_action_dec_nw_ttl_ipv4(self, dp):
self._verify = [dp.ofproto.OFPAT_DEC_NW_TTL]
@ -458,7 +469,6 @@ class RunTest(tester.TestFlowBase):
'test_action_set_field_arp',
'test_action_set_field_ipv6',
'test_action_set_field_icmp',
'test_action_set_nw_ttl',
'test_action_copy_ttl_in',
'test_action_copy_ttl_out',
'test_action_dec_mpls_ttl',