diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2016-05-30 15:28:20 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-01 20:40:17 +0900 |
commit | 1bcb23e5564a1305f7629201db15c9be06badb10 (patch) | |
tree | 1ae6f3e7ffdaa6fd71f7f9ae761cfa40a8c7f57e | |
parent | 709b3ad28fd010b9566efdfb50a87751e901dc2b (diff) |
packet_data_generator3: Clear xid into zero
Because ovs-ofctl increments the xid field automatically, the xid
of the generated packets is set to be 0x02.
So, we should specify {"xid": 2} in json data, but when Ryu dumping
json data from message instance, "xid" are omitted and this causes
assertion error in test_parser.py
This patch enables to clear the xid filed in the generated packets
and solves this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
25 files changed, 14 insertions, 25 deletions
diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_conjunction.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_conjunction.packet Binary files differindex 40a91016..ba029b2c 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_conjunction.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_conjunction.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct.packet Binary files differindex 3d802d98..3aff2bdc 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_exec.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_exec.packet Binary files differindex 88bdf52b..3f0b3431 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_exec.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_exec.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat.packet Binary files differindex 2d5ec7a8..e210a38c 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat_v6.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat_v6.packet Binary files differindex a3b94113..94b2aaa9 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat_v6.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat_v6.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_learn.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_learn.packet Binary files differindex 387e59ec..39c71e20 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_learn.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_learn.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_resubmit.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_resubmit.packet Binary files differindex 9e8560cf..690b978b 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_resubmit.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-action_resubmit.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_conj.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_conj.packet Binary files differindex 74a1c0ef..1f9c57cd 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_conj.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_conj.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_load_nx_register.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_load_nx_register.packet Binary files differindex 8b738c8c..03ce7374 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_load_nx_register.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_load_nx_register.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_move_nx_register.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_move_nx_register.packet Binary files differindex 536db74a..eb9cf8a6 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_move_nx_register.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_move_nx_register.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark.packet Binary files differindex a9e4cb8c..46ea0dc9 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark.packet diff --git a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet Binary files differindex 99393128..26db6b92 100644 --- a/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet +++ b/ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet diff --git a/ryu/tests/packet_data_generator3/gen.py b/ryu/tests/packet_data_generator3/gen.py index bd16c163..ddf772c0 100644 --- a/ryu/tests/packet_data_generator3/gen.py +++ b/ryu/tests/packet_data_generator3/gen.py @@ -162,7 +162,8 @@ class MyHandler(socketserver.BaseRequestHandler): hello.serialize() self.request.send(hello.buf) elif msg_type == desc.ofproto.OFPT_FLOW_MOD: - buf.append(data[:msg_len]) + # HACK: Clear xid into zero + buf.append(data[:4] + b'\x00\x00\x00\x00' + data[8:msg_len]) elif msg_type == desc.ofproto.OFPT_BARRIER_REQUEST: brep = desc.ofproto_parser.OFPBarrierReply(desc) brep.xid = xid diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_conjunction.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_conjunction.packet.json index 7f89c5ea..edc10939 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_conjunction.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_conjunction.packet.json @@ -95,7 +95,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 2, - "xid": 2 + "table_id": 2 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct.packet.json index 0c8670f8..258da237 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct.packet.json @@ -56,7 +56,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_exec.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_exec.packet.json index 886f9d8b..83276442 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_exec.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_exec.packet.json @@ -70,7 +70,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat.packet.json index 6052ec1b..85aae120 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat.packet.json @@ -65,7 +65,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat_v6.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat_v6.packet.json index c5e3d50a..31f94374 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat_v6.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat_v6.packet.json @@ -65,7 +65,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_learn.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_learn.packet.json index 5d86c881..c874c2e9 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_learn.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_learn.packet.json @@ -187,7 +187,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 2, - "xid": 2 + "table_id": 2 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_resubmit.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_resubmit.packet.json index c0404958..1fdedc55 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_resubmit.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_resubmit.packet.json @@ -94,7 +94,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_conj.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_conj.packet.json index 2b500014..6b1c2864 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_conj.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_conj.packet.json @@ -55,7 +55,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_load_nx_register.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_load_nx_register.packet.json index 0b173a48..adf14ca7 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_load_nx_register.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_load_nx_register.packet.json @@ -54,7 +54,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_move_nx_register.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_move_nx_register.packet.json index 5143a3d5..48ced9f6 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_move_nx_register.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_move_nx_register.packet.json @@ -55,7 +55,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark.packet.json index 1cba8c6f..61aee954 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark.packet.json @@ -55,7 +55,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } diff --git a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet.json b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet.json index 89314867..a7bd2367 100644 --- a/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet.json @@ -55,7 +55,6 @@ "out_group": 4294967295, "out_port": 4294967295, "priority": 32768, - "table_id": 3, - "xid": 2 + "table_id": 3 } } |