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.yusu...@gmail.com> --- .../of13/ovs-ofctl-of13-action_conjunction.packet | Bin 144 -> 144 bytes .../packet_data/of13/ovs-ofctl-of13-action_ct.packet | Bin 104 -> 104 bytes .../of13/ovs-ofctl-of13-action_ct_exec.packet | Bin 120 -> 120 bytes .../of13/ovs-ofctl-of13-action_ct_nat.packet | Bin 128 -> 128 bytes .../of13/ovs-ofctl-of13-action_ct_nat_v6.packet | Bin 144 -> 144 bytes .../packet_data/of13/ovs-ofctl-of13-action_learn.packet | Bin 256 -> 256 bytes .../of13/ovs-ofctl-of13-action_resubmit.packet | Bin 144 -> 144 bytes .../packet_data/of13/ovs-ofctl-of13-match_conj.packet | Bin 96 -> 96 bytes .../of13/ovs-ofctl-of13-match_load_nx_register.packet | Bin 104 -> 104 bytes .../of13/ovs-ofctl-of13-match_move_nx_register.packet | Bin 104 -> 104 bytes .../of13/ovs-ofctl-of13-match_pkt_mark.packet | Bin 96 -> 96 bytes .../of13/ovs-ofctl-of13-match_pkt_mark_masked.packet | Bin 96 -> 96 bytes ryu/tests/packet_data_generator3/gen.py | 3 ++- .../of13/ovs-ofctl-of13-action_conjunction.packet.json | 3 +-- .../json/of13/ovs-ofctl-of13-action_ct.packet.json | 3 +-- .../json/of13/ovs-ofctl-of13-action_ct_exec.packet.json | 3 +-- .../json/of13/ovs-ofctl-of13-action_ct_nat.packet.json | 3 +-- .../of13/ovs-ofctl-of13-action_ct_nat_v6.packet.json | 3 +-- .../json/of13/ovs-ofctl-of13-action_learn.packet.json | 3 +-- .../of13/ovs-ofctl-of13-action_resubmit.packet.json | 3 +-- .../json/of13/ovs-ofctl-of13-match_conj.packet.json | 3 +-- .../ovs-ofctl-of13-match_load_nx_register.packet.json | 3 +-- .../ovs-ofctl-of13-match_move_nx_register.packet.json | 3 +-- .../json/of13/ovs-ofctl-of13-match_pkt_mark.packet.json | 3 +-- .../ovs-ofctl-of13-match_pkt_mark_masked.packet.json | 3 +-- 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 index 40a91016d86d16178622d29911d8f35e0db02621..ba029b2c4797d6ef3a378cc555ce50b209127bc9 100644 GIT binary patch delta 16 WcmbQhIDwIag^ytZ0}xE)=l}p1?*i@s delta 16 XcmbQhIDwIag^ytZ0|NuoM2-#s821A3 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 index 3d802d984deac71b9ee031cad4fb70ace8a200ff..3aff2bdc3e516a200a34604ce6236b10b247cd03 100644 GIT binary patch delta 14 Tcmd1E;9%in$Y211i5v+45rG0s delta 14 Vcmd1E;9%in$Y5Y#V4BF0000q*0!{z` 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 index 88bdf52b65b438d2d2008abfd35652d31f451d0b..3f0b3431295f706a18cb371ac1f72a0b1ed38b96 100644 GIT binary patch delta 14 Tcmb=Z;9%ins9*qsi5vw06Tt$E delta 14 Vcmb=Z;9%ins9<1VV4BEL000xo0*(Lx 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 index 2d5ec7a89cff2a473032faeadc249fcf18023d94..e210a38c2e03328dcaaae464f76b84b6e04d510e 100644 GIT binary patch delta 16 VcmZo*Y+&SI;bUlE0D_4e6#y200<Hi6 delta 16 XcmZo*Y+&SI;bUlEU|?XH$WZ|R7KZ|` 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 index a3b941137e83091791704645b7175af9f1535d0b..94b2aaa98917b8f4ffd49bdcdffa197ba7741713 100644 GIT binary patch delta 16 WcmbQhIDwIag^ytZ0}xE)=l}p1?*i@s delta 16 XcmbQhIDwIag^ytZ0|NuoM2-#s821A3 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 index 387e59ecd5ddbb30bf794904bf90131ff8b3eae4..39c71e2073f6858c0ef5e289fe3f43291e48fcd7 100644 GIT binary patch delta 16 UcmZo*YGC4E;bUX~fr%VH023qvu>b%7 delta 16 VcmZo*YGC4E;bUX~0;Y)^KL8Uf0<!=B 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 index 9e8560cf1106a94ae6e90fd2bcc8e01836a9a869..690b978b0ea52cecb39ef793b5f56c8aa3e38d1e 100644 GIT binary patch delta 16 WcmbQhIDwIag^ytZ0}xE)=l}p1?*i@s delta 16 XcmbQhIDwIag^ytZ0|NuoM2-#s821A3 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 index 74a1c0ef0acc92c518469d7af74d66d197196ef8..1f9c57cd62515387dd7b78c21d6958213753a1dd 100644 GIT binary patch delta 14 TcmYdD;9%inNMHbhi5w9C5Mcr= delta 14 VcmYdD;9%inNMK-KV4BDg0RRwb0xkdm 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 index 8b738c8cc3b634d6361d6cd4c65de4c95ee55d58..03ce737407af740881375c069fb578322ccd3167 100644 GIT binary patch delta 14 Tcmd1E;9%in$Y211i5v+45rG0s delta 14 Vcmd1E;9%in$Y5Y#V4BF0000q*0!{z` 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 index 536db74aac26a91c440797d243e618753c934410..eb9cf8a623d5942e5e6392a984fb7db92cc9221f 100644 GIT binary patch delta 14 Tcmd1E;9%in$Y211i5v+45rG0s delta 14 Vcmd1E;9%in$Y5Y#V4BF0000q*0!{z` 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 index a9e4cb8ce05e71e1ac0555178e0e8ba393eb087a..46ea0dc9283f5a1397cb4fe74e5b163b30a4fa54 100644 GIT binary patch delta 14 TcmYdD;9%inNMHbhi5w9C5Mcr= delta 14 VcmYdD;9%inNMK-KV4BDg0RRwb0xkdm 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 index 993931287371bb14296de561e11ccd3215b39cf2..26db6b92e7fa1b71fd7bd315798e4c4f4c3da918 100644 GIT binary patch delta 14 TcmYdD;9%inNMHbhi5w9C5Mcr= delta 14 VcmYdD;9%inNMK-KV4BDg0RRwb0xkdm diff --git a/ryu/tests/packet_data_generator3/gen.py b/ryu/tests/packet_data_generator3/gen.py index bd16c16..ddf772c 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 7f89c5e..edc1093 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 0c8670f..258da23 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 886f9d8..8327644 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 6052ec1..85aae12 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 c5e3d50..31f9437 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 5d86c88..c874c2e 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 c040495..1fdedc5 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 2b50001..6b1c286 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 0b173a4..adf14ca 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 5143a3d..48ced9f 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 1cba8c6..61aee95 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 8931486..a7bd236 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 } } -- 2.7.4 ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel