summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMinoru TAKAHASHI <takahashi.minoru7@gmail.com>2016-03-10 13:19:17 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-03-11 23:44:03 +0900
commit801bdacbe375762b22d6a5ddad74645b02ab061d (patch)
tree12c5bbb0b7988587252b5014e47257b508225285
parent7316f86034261c9663f001a5464da4786df7fece (diff)
ofproto_v1_3: Add unit test cases for action experimenter
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/packet_data/of13/4-12-ofp_flow_stats_reply.packetbin520 -> 552 bytes
-rw-r--r--ryu/tests/packet_data/of13/4-2-ofp_flow_mod.packetbin264 -> 280 bytes
-rw-r--r--ryu/tests/packet_data_generator/src/x4.erl10
-rw-r--r--ryu/tests/unit/ofproto/json/of13/4-12-ofp_flow_stats_reply.packet.json21
-rw-r--r--ryu/tests/unit/ofproto/json/of13/4-2-ofp_flow_mod.packet.json14
5 files changed, 39 insertions, 6 deletions
diff --git a/ryu/tests/packet_data/of13/4-12-ofp_flow_stats_reply.packet b/ryu/tests/packet_data/of13/4-12-ofp_flow_stats_reply.packet
index 90ff2490..c7c1ac88 100644
--- a/ryu/tests/packet_data/of13/4-12-ofp_flow_stats_reply.packet
+++ b/ryu/tests/packet_data/of13/4-12-ofp_flow_stats_reply.packet
Binary files differ
diff --git a/ryu/tests/packet_data/of13/4-2-ofp_flow_mod.packet b/ryu/tests/packet_data/of13/4-2-ofp_flow_mod.packet
index 5e2a9d69..0c2029bd 100644
--- a/ryu/tests/packet_data/of13/4-2-ofp_flow_mod.packet
+++ b/ryu/tests/packet_data/of13/4-2-ofp_flow_mod.packet
Binary files differ
diff --git a/ryu/tests/packet_data_generator/src/x4.erl b/ryu/tests/packet_data_generator/src/x4.erl
index 6098b456..a749fbc8 100644
--- a/ryu/tests/packet_data_generator/src/x4.erl
+++ b/ryu/tests/packet_data_generator/src/x4.erl
@@ -268,6 +268,9 @@ x() ->
#ofp_action_set_mpls_ttl{mpls_ttl = 10},
#ofp_action_dec_nw_ttl{},
#ofp_action_set_nw_ttl{nw_ttl = 10},
+ #ofp_action_experimenter{
+ experimenter = 101,
+ data = <<0,1,2,3,4,5,6,7>>},
#ofp_action_set_queue{queue_id = 3},
#ofp_action_group{group_id = 99},
#ofp_action_output{port = 6,max_len = no_buffer}]},
@@ -449,7 +452,12 @@ x() ->
#ofp_action_set_queue{queue_id = 3},
#ofp_action_group{group_id = 99},
#ofp_action_output{port = 6,
- max_len = no_buffer}]},
+ max_len = no_buffer},
+ #ofp_action_experimenter{experimenter = 98765432,
+ data = <<"exp_data">>},
+ #ofp_action_experimenter{experimenter = 8992,
+ data = <<"exp_data">>}
+ ]},
#ofp_instruction_apply_actions{
actions =
[#ofp_action_set_field{
diff --git a/ryu/tests/unit/ofproto/json/of13/4-12-ofp_flow_stats_reply.packet.json b/ryu/tests/unit/ofproto/json/of13/4-12-ofp_flow_stats_reply.packet.json
index 32505271..04339dc3 100644
--- a/ryu/tests/unit/ofproto/json/of13/4-12-ofp_flow_stats_reply.packet.json
+++ b/ryu/tests/unit/ofproto/json/of13/4-12-ofp_flow_stats_reply.packet.json
@@ -249,9 +249,26 @@
"port": 6,
"type": 0
}
+ },
+ {
+ "OFPActionExperimenterUnknown": {
+ "len": 16,
+ "data": "ZXhwX2RhdGE=",
+ "experimenter": 98765432,
+ "type": 65535
+ }
+ },
+ {
+ "NXActionUnknown": {
+ "len": 16,
+ "data": "cF9kYXRh",
+ "experimenter": 8992,
+ "type": 65535,
+ "subtype": 25976
+ }
}
],
- "len": 160,
+ "len": 192,
"type": 3
}
},
@@ -306,7 +323,7 @@
}
}
],
- "length": 280,
+ "length": 312,
"match": {
"OFPMatch": {
"length": 4,
diff --git a/ryu/tests/unit/ofproto/json/of13/4-2-ofp_flow_mod.packet.json b/ryu/tests/unit/ofproto/json/of13/4-2-ofp_flow_mod.packet.json
index e2c0e82b..0e3a2cc3 100644
--- a/ryu/tests/unit/ofproto/json/of13/4-2-ofp_flow_mod.packet.json
+++ b/ryu/tests/unit/ofproto/json/of13/4-2-ofp_flow_mod.packet.json
@@ -107,7 +107,15 @@
"nw_ttl": 10,
"type": 23
}
- },
+ },
+ {
+ "OFPActionExperimenterUnknown": {
+ "data": "AAECAwQFBgc=",
+ "experimenter": 101,
+ "len": 16,
+ "type": 65535
+ }
+ },
{
"OFPActionSetQueue": {
"len": 8,
@@ -130,8 +138,8 @@
"type": 0
}
}
- ],
- "len": 160,
+ ],
+ "len": 176,
"type": 3
}
},