P2P tests dump traffic for debug purposes.

This patch adds a new tcpdump.py library to run a tcpdump process
on the background capturing packets to a file. When setting up a
P2P test environment, a new TAP interface is created to simulate
the peers on that network.

This patch records the traffic on that TAP interface and makes it
available on the results directory on the test. The filename used
is dump-<iface-name>.pcap, usually dump-faketap0.pcap.

BUG=chromium:328078
TEST=test_that --fast -b $BOARD $HOST p2p_ServeFiles

Change-Id: Icc9ab81d6e3db1be4eb0431f0e5f194ae170517b
Reviewed-on: https://chromium-review.googlesource.com/181163
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
3 files changed