diff options
author | Simon Horman <horms@verge.net.au> | 2014-03-11 10:42:03 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-03-16 21:42:21 +0900 |
commit | 2316f5e03b9178d2902c892e26e6ae5dea7e49e8 (patch) | |
tree | 5f2999b124ca1c4a36abb43d4bf6244a9fa2d21b | |
parent | dad67544d9bbef085409f3d8a8528c777a48f263 (diff) |
of14: Add flow monitor reply message unit test
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/packet_data/of14/5-67-ofp_flow_monitor_reply.packet | bin | 0 -> 96 bytes | |||
-rw-r--r-- | ryu/tests/packet_data_generator/src/x5.erl | 30 | ||||
-rw-r--r-- | ryu/tests/unit/ofproto/json/of14/5-67-ofp_flow_monitor_reply.packet.json | 66 |
3 files changed, 95 insertions, 1 deletions
diff --git a/ryu/tests/packet_data/of14/5-67-ofp_flow_monitor_reply.packet b/ryu/tests/packet_data/of14/5-67-ofp_flow_monitor_reply.packet Binary files differnew file mode 100644 index 00000000..b50fe8f5 --- /dev/null +++ b/ryu/tests/packet_data/of14/5-67-ofp_flow_monitor_reply.packet diff --git a/ryu/tests/packet_data_generator/src/x5.erl b/ryu/tests/packet_data_generator/src/x5.erl index 53e85ab6..1611ab97 100644 --- a/ryu/tests/packet_data_generator/src/x5.erl +++ b/ryu/tests/packet_data_generator/src/x5.erl @@ -2814,6 +2814,34 @@ x() -> class = openflow_basic,name = eth_dst, has_mask = false, value = <<"\362\v\244}\370\352">>, - mask = undefined}]}} + mask = undefined}]}}, + #ofp_flow_monitor_reply{ + flags = [], + updates = + [#ofp_flow_update_full{ + event = initial, + table_id = 0, + reason = idle_timeout, + idle_timeout = 600, + hard_timeout = 700, + priority = 3, + cookie = <<0,0,0,0,0,0,0,0>>, + match = + #ofp_match{ + fields = + [#ofp_field{ + class = openflow_basic, + name = eth_type, + has_mask = false, + value = <<8,6>>, + mask = undefined}]}, + instructions = + [#ofp_instruction_apply_actions{ + actions = + [#ofp_action_output{ + port = normal, + max_len = 0}]}]}, + #ofp_flow_update_abbrev{event = abbrev,xid=1234}, + #ofp_flow_update_paused{event = paused}]} ], lists:foldl(fun x:do/2, {5, 0}, List). diff --git a/ryu/tests/unit/ofproto/json/of14/5-67-ofp_flow_monitor_reply.packet.json b/ryu/tests/unit/ofproto/json/of14/5-67-ofp_flow_monitor_reply.packet.json new file mode 100644 index 00000000..8c028877 --- /dev/null +++ b/ryu/tests/unit/ofproto/json/of14/5-67-ofp_flow_monitor_reply.packet.json @@ -0,0 +1,66 @@ +{ + "OFPFlowMonitorReply": { + "body": [ + { + "OFPFlowUpdateFull": { + "cookie": 0, + "event": 0, + "hard_timeout": 700, + "idle_timeout": 600, + "instructions": [ + { + "OFPInstructionActions": { + "actions": [ + { + "OFPActionOutput": { + "len": 16, + "max_len": 0, + "port": 4294967290, + "type": 0 + } + } + ], + "len": 24, + "type": 4 + } + } + ], + "length": 64, + "match": { + "OFPMatch": { + "length": 10, + "oxm_fields": [ + { + "OXMTlv": { + "field": "eth_type", + "mask": null, + "value": 2054 + } + } + ], + "type": 1 + } + }, + "priority": 3, + "reason": 0, + "table_id": 0 + } + }, + { + "OFPFlowUpdateAbbrev": { + "event": 4, + "length": 8, + "xid": 1234 + } + }, + { + "OFPFlowUpdatePaused": { + "event": 5, + "length": 8 + } + } + ], + "flags": 0, + "type": 16 + } +} |