diff options
author | Louis Scalbert <louis.scalbert@6wind.com> | 2024-11-21 11:29:53 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2024-12-02 18:44:53 +0100 |
commit | f2eb14d381b7e490c0ed1394d1955fa860d9b018 (patch) | |
tree | 27d26aaf35348162181cfe7500ae234cc47837b5 | |
parent | tests: fix bmp test parallelization (diff) | |
download | frr-f2eb14d381b7e490c0ed1394d1955fa860d9b018.tar.xz frr-f2eb14d381b7e490c0ed1394d1955fa860d9b018.zip |
tests: save bmp pcap in logdir instead of /tmp
DEBUG_PCAP can be set True to manually enable pcap debugging when
running bmp tests.
Save bmp pcap in logdir (ie. /tmp/topotests/bgp_bmp.bgp_bmp_X/ instead
of /tmp.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
-rw-r--r-- | tests/topotests/bgp_bmp/test_bgp_bmp_1.py | 4 | ||||
-rw-r--r-- | tests/topotests/bgp_bmp/test_bgp_bmp_2.py | 4 | ||||
-rwxr-xr-x | tests/topotests/lib/bmp_collector/bmpserver.py | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp_1.py b/tests/topotests/bgp_bmp/test_bgp_bmp_1.py index 493f357f4..9fc8e1277 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 82d3824a1..21e4ce8ab 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 @@ ip link set r1vrf-eth1 master vrf1 ) 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 a7c9743c9..c42c38756 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 <farid.mihoub@6wind.com> # import argparse +import errno +import logging # XXX: something more reliable should be used "Twisted" a great choice. import os |