summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-05-30 15:28:20 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-06-01 20:40:17 +0900
commit1bcb23e5564a1305f7629201db15c9be06badb10 (patch)
tree1ae6f3e7ffdaa6fd71f7f9ae761cfa40a8c7f57e
parent709b3ad28fd010b9566efdfb50a87751e901dc2b (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>
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-action_conjunction.packetbin144 -> 144 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct.packetbin104 -> 104 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_exec.packetbin120 -> 120 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat.packetbin128 -> 128 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-action_ct_nat_v6.packetbin144 -> 144 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-action_learn.packetbin256 -> 256 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-action_resubmit.packetbin144 -> 144 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-match_conj.packetbin96 -> 96 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-match_load_nx_register.packetbin104 -> 104 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-match_move_nx_register.packetbin104 -> 104 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark.packetbin96 -> 96 bytes
-rw-r--r--ryu/tests/packet_data/of13/ovs-ofctl-of13-match_pkt_mark_masked.packetbin96 -> 96 bytes
-rw-r--r--ryu/tests/packet_data_generator3/gen.py3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_conjunction.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_exec.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_ct_nat_v6.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_learn.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-action_resubmit.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_conj.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_load_nx_register.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_move_nx_register.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark.packet.json3
-rw-r--r--ryu/tests/unit/ofproto/json/of13/ovs-ofctl-of13-match_pkt_mark_masked.packet.json3
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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 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
Binary files differ
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
}
}