make test: improve handling of packet captures 52/4452/5
authorKlement Sekera <ksekera@cisco.com>
Wed, 21 Dec 2016 07:50:14 +0000 (08:50 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 23 Dec 2016 17:38:33 +0000 (17:38 +0000)
commitdab231a11ec96e829b22ff80c612333edc5a93e6
treee3440df2b4bc1af7a0e4973c0bfa839572d87c4d
parentfc262a0cf77e3c14ff1d6c006e7eac70999b926f
make test: improve handling of packet captures

Perform accounting of expected packets based on created packet infos.
Use this accounting info to automatically expect (and verify) the
correct number of packets to be captured. Automatically retry the read
of the capture file if scapy raises an exception while doing so to
handle rare cases when capture file is read while only partially
written during busy wait. Don't fail assert_nothing_captured if only
junk packets arrived.

Change-Id: I16ec2e9410ef510d313ec16b7e13c57d0b2a63f5
Signed-off-by: Klement Sekera <ksekera@cisco.com>
19 files changed:
test/framework.py
test/template_bd.py
test/test_bfd.py
test/test_classifier.py
test/test_gre.py
test/test_ip4.py
test/test_ip4_irb.py
test/test_ip6.py
test/test_l2_fib.py
test/test_l2bd.py
test/test_l2bd_multi_instance.py
test/test_l2xc.py
test/test_l2xc_multi_instance.py
test/test_lb.py
test/test_mpls.py
test/test_snat.py
test/test_span.py
test/util.py
test/vpp_pg_interface.py