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]>
Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
louis-6wind authored and pguibert6WIND committed Dec 2, 2024
1 parent 54a83e2 commit 1951c83
Show file tree
Hide file tree
Showing 3 changed files with 6 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
2 changes: 2 additions & 0 deletions tests/topotests/lib/bmp_collector/bmpserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# Authored by Farid Mihoub <[email protected]>
#
import argparse
import errno
import logging

# XXX: something more reliable should be used "Twisted" a great choice.
import os
Expand Down

0 comments on commit 1951c83

Please sign in to comment.