Skip to content

Commit

Permalink
tests: save bmp pcap in logdir instead of /tmp
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
louis-6wind authored and pguibert6WIND committed Nov 21, 2024
1 parent c8381ce commit 4118279
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/topotests/bgp_bmp/test_bgp_bmp_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/bgp_bmp/test_bgp_bmp_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 4118279

Please sign in to comment.