diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp_1.py b/tests/topotests/bgp_bmp/test_bgp_bmp_1.py index 493f357f4b4b..9fc8e127720f 100644 --- a/tests/topotests/bgp_bmp/test_bgp_bmp_1.py +++ b/tests/topotests/bgp_bmp/test_bgp_bmp_1.py @@ -73,9 +73,9 @@ def setup_module(mod): tgen.start_topology() if DEBUG_PCAP: - tgen.gears["r1"].run("rm /tmp/bmp.pcap") + pcap_file = os.path.join(tgen.logdir, "r1/bmp.pcap") tgen.gears["r1"].run( - "tcpdump -nni r1-eth0 -s 0 -w /tmp/bmp.pcap &", stdout=None + "tcpdump -nni r1-eth0 -s 0 -w {} &".format(pcap_file), stdout=None ) for rname, router in tgen.routers().items(): diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp_2.py b/tests/topotests/bgp_bmp/test_bgp_bmp_2.py index 82d3824a1b93..21e4ce8abeae 100644 --- a/tests/topotests/bgp_bmp/test_bgp_bmp_2.py +++ b/tests/topotests/bgp_bmp/test_bgp_bmp_2.py @@ -85,9 +85,9 @@ def setup_module(mod): ) bmp_reset_seq() if DEBUG_PCAP: - tgen.gears["r1vrf"].run("rm /tmp/bmp_vrf.pcap") + pcap_file = os.path.join(tgen.logdir, "r1vrf/bmp.pcap") tgen.gears["r1vrf"].run( - "tcpdump -nni r1vrf-eth0 -s 0 -w /tmp/bmp_vrf.pcap &", stdout=None + "tcpdump -nni r1vrf-eth0 -s 0 -w {} &".format(pcap_file), stdout=None ) for rname, router in tgen.routers().items(): diff --git a/tests/topotests/lib/bmp_collector/bmpserver.py b/tests/topotests/lib/bmp_collector/bmpserver.py index a7c9743c9604..c42c3875633f 100755 --- a/tests/topotests/lib/bmp_collector/bmpserver.py +++ b/tests/topotests/lib/bmp_collector/bmpserver.py @@ -5,6 +5,8 @@ # Authored by Farid Mihoub # import argparse +import errno +import logging # XXX: something more reliable should be used "Twisted" a great choice. import os