summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2014-03-11 10:42:10 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-03-16 21:42:28 +0900
commit281067bf2b42b1e2b05420b1b46cbc705386bcc4 (patch)
tree565b0686024b8f8d8bc2193f8924549cc9d9a901
parentd3e1e267f14801ee50b69b2f89d3e558834d2754 (diff)
of14: Add bundle control 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-69-ofp_bundle_ctrl_msg.packetbin0 -> 72 bytes
-rw-r--r--ryu/tests/packet_data_generator/src/x5.erl19
-rw-r--r--ryu/tests/unit/ofproto/json/of14/5-69-ofp_bundle_ctrl_msg.packet.json36
-rw-r--r--ryu/tests/unit/ofproto/test_parser.py1
4 files changed, 55 insertions, 1 deletions
diff --git a/ryu/tests/packet_data/of14/5-69-ofp_bundle_ctrl_msg.packet b/ryu/tests/packet_data/of14/5-69-ofp_bundle_ctrl_msg.packet
new file mode 100644
index 00000000..8df1e6f8
--- /dev/null
+++ b/ryu/tests/packet_data/of14/5-69-ofp_bundle_ctrl_msg.packet
Binary files differ
diff --git a/ryu/tests/packet_data_generator/src/x5.erl b/ryu/tests/packet_data_generator/src/x5.erl
index 4490ac7f..aafb37f6 100644
--- a/ryu/tests/packet_data_generator/src/x5.erl
+++ b/ryu/tests/packet_data_generator/src/x5.erl
@@ -2955,6 +2955,23 @@ x() ->
#ofp_table_mod_prop_experimenter{
experimenter = 101,
exp_type = 2,
- data = <<1:32,2:32>>}]}}
+ data = <<1:32,2:32>>}]}},
+ #ofp_bundle_ctrl_msg{
+ bundle_id = 1234,
+ type = open_request,
+ flags = [atomic],
+ properties =
+ [#ofp_bundle_prop_experimenter{
+ experimenter = 101,
+ exp_type = 0,
+ data = <<>>},
+ #ofp_bundle_prop_experimenter{
+ experimenter = 101,
+ exp_type = 1,
+ data = <<1:32>>},
+ #ofp_bundle_prop_experimenter{
+ experimenter = 101,
+ exp_type = 2,
+ data = <<1:32,2:32>>}]}
],
lists:foldl(fun x:do/2, {5, 0}, List).
diff --git a/ryu/tests/unit/ofproto/json/of14/5-69-ofp_bundle_ctrl_msg.packet.json b/ryu/tests/unit/ofproto/json/of14/5-69-ofp_bundle_ctrl_msg.packet.json
new file mode 100644
index 00000000..370036fd
--- /dev/null
+++ b/ryu/tests/unit/ofproto/json/of14/5-69-ofp_bundle_ctrl_msg.packet.json
@@ -0,0 +1,36 @@
+{
+ "OFPBundleCtrlMsg": {
+ "bundle_id": 1234,
+ "flags": 1,
+ "properties": [
+ {
+ "OFPBundlePropExperimenter": {
+ "data": "",
+ "exp_type": 0,
+ "experimenter": 101,
+ "length": 12,
+ "type": 65535
+ }
+ },
+ {
+ "OFPBundlePropExperimenter": {
+ "data": "AAAAAQ==",
+ "exp_type": 1,
+ "experimenter": 101,
+ "length": 16,
+ "type": 65535
+ }
+ },
+ {
+ "OFPBundlePropExperimenter": {
+ "data": "AAAAAQAAAAI=",
+ "exp_type": 2,
+ "experimenter": 101,
+ "length": 20,
+ "type": 65535
+ }
+ }
+ ],
+ "type": 0
+ }
+}
diff --git a/ryu/tests/unit/ofproto/test_parser.py b/ryu/tests/unit/ofproto/test_parser.py
index cac78b48..d07bf9dd 100644
--- a/ryu/tests/unit/ofproto/test_parser.py
+++ b/ryu/tests/unit/ofproto/test_parser.py
@@ -113,6 +113,7 @@ implemented = {
ofproto_v1_4.OFPT_SET_ASYNC: (False, True),
ofproto_v1_4.OFPT_ROLE_STATUS: (True, False),
ofproto_v1_4.OFPT_TABLE_STATUS: (True, False),
+ ofproto_v1_4.OFPT_BUNDLE_CONTROL: (False, True),
},
}