summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2014-04-25 10:20:09 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-04-25 18:49:33 +0900
commitd5e433ee04c502b08390c0f7143b54577dcb8a0d (patch)
tree8ab630ce55f859fe87cbc3572518bdb74409dea5
parentec02de8d7a5ffefb52d746c21a1cb637873c570f (diff)
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>
-rw-r--r--ryu/tests/integrated/test_add_flow_v12_actions.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/ryu/tests/integrated/test_add_flow_v12_actions.py b/ryu/tests/integrated/test_add_flow_v12_actions.py
index 99cc1d78..0827932a 100644
--- a/ryu/tests/integrated/test_add_flow_v12_actions.py
+++ b/ryu/tests/integrated/test_add_flow_v12_actions.py
@@ -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',