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>
This commit is contained in:
IWASE Yusuke 2016-05-30 15:28:20 +09:00 committed by FUJITA Tomonori
parent 709b3ad28f
commit 1bcb23e556
25 changed files with 14 additions and 25 deletions

View File

@ -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

View File

@ -95,7 +95,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 2,
"xid": 2
"table_id": 2
}
}

View File

@ -56,7 +56,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -70,7 +70,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -65,7 +65,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -65,7 +65,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -187,7 +187,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 2,
"xid": 2
"table_id": 2
}
}

View File

@ -94,7 +94,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -55,7 +55,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -54,7 +54,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -55,7 +55,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -55,7 +55,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}

View File

@ -55,7 +55,6 @@
"out_group": 4294967295,
"out_port": 4294967295,
"priority": 32768,
"table_id": 3,
"xid": 2
"table_id": 3
}
}