make test: work around scapy truncated packets 84/5084/1
authorKlement Sekera <ksekera@cisco.com>
Thu, 9 Feb 2017 05:04:36 +0000 (06:04 +0100)
committerKlement Sekera <ksekera@cisco.com>
Thu, 9 Feb 2017 05:10:47 +0000 (06:10 +0100)
commitb91017a30b3a2034c47008e7bcfe7bda49fe7c57
tree46ffcfd254494dd8aef8e1dd8fd8b190b412189e
parentc756c1c7903feca20194bf3ba88863307668106a
make test: work around scapy truncated packets

Under stress, it's possible to hit a race condition, when the packet
header is fully written to pcap, but not all packet data - yet.
Scapy is stupid enough to:
1. not detect and report this error, truncating the packet instead
2. continue munching more data from wrong offset
The work around is to scan the file ahead, parse the packet header,
figure out how much data we need, wait for the file to be big
enough, then restore the file position back to where it was
and finally let scapy parse the packet.

Change-Id: I9fc71d3ebdc62ecab6c90b90f177d0eaeb09b8bb
Signed-off-by: Klement Sekera <ksekera@cisco.com>
test/framework.py
test/vpp_pg_interface.py