-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BMP test rework #17306
BMP test rework #17306
Conversation
9c1b97b
to
9c91da3
Compare
77e03e2
to
fcdaf71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, waiting on ci
ci:rerun |
Some python errors: https://github.com/FRRouting/frr/pull/17306/checks?check_run_id=32523042172 |
done |
4a1c38d
to
f68a64e
Compare
2ee8f99
to
c8381ce
Compare
tgen.start_topology() | ||
|
||
if DEBUG_PCAP: | ||
tgen.gears["r1"].run("rm /tmp/bmp.pcap") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, this should be something more granular, because if you run this in parallel, it won't work... Same for tcpdump below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEBUG_PCAP is never enabled when running tests if this is what you fear.
Eventually, I can add a comment to say to not enable it while in CIP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concern here is that you are writing to a arbitrary bit of the tmp directory when the FRR topotests already have a well established system in place where capturing log files exist in relation to what is going on. Let's try to keep this clean and consistent so that the next person doesn't add something to plain old /tmp and cause a real problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could commit 4118279 help ?
4118279
to
ea42a86
Compare
Can we fix this?
|
ea42a86
to
634ea31
Compare
done |
634ea31
to
c01ffee
Compare
ci:rerun bfd test fail dont know why |
tests/topotests/bgp_bmp/bgpbmp.py
Outdated
filtered_out["routes"][pfx] = None | ||
|
||
# ls /tmp/show*json | while read file; do egrep -v 'prefix|network|metric|ocPrf|version|weight|peerId|vrf|Version|valid|Reason|fe80' $file >$(basename $file); echo >> $(basename $file); done | ||
with open(f"/tmp/show-bgp-ipv4-{bmp_log_type}-step{step}.json", "w") as json_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be in the relevant test directory for the exact same reason as outlined before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done, Donald. I think we matched all necessary changes.
The bgp_bmp and bgp_bmp_vrf tests use similar routines to test the bmp, but are duplicates. Gather the bgp_bmp and the bgp_bmp_vrf tests in a single bgp_bmp folder. - Create a bgpbmp.py library under the bgp_bmp test folder - The bgp_bmp and bgp_bmp_vrf test are renamed to bgp_bmp_1 and bgp_bmp_2 test. - Maintain separate folder for config and output results. Adapt the bgp_bmp library accordingly. - The json output for bgp_bmp_2 test has no referenc to hostame. Signed-off-by: Philippe Guibert <[email protected]>
When configuring the bgp_bmp test with an additional peer that sends empty AS-PATH, the bmp collector is stopping: > [2024-10-28 17:41:51] Finished dissecting data from ('192.0.2.1', 33922) > [2024-10-28 17:41:52] Data received from ('192.0.2.1', 33922): length 195 > [2024-10-28 17:41:52] Got message type: <class 'bmp.BMPRouteMonitoring'> > [2024-10-28 17:41:52] unpack_from requires a buffer of at least 2 bytes for unpacking 2 bytes at offset 0 (actual buffer size is 0) > [2024-10-28 17:41:52] TCP session closed with ('192.0.2.1', 33922) > [2024-10-28 17:41:52] Server shutting down on 192.0.2.10:1789 The parser attempts to read an empty AS-path and considers the length value as a length in bytes, whereas RFC mentions this value as definining the number of AS-PAths. Fix this in the parser. Signed-off-by: Philippe Guibert <[email protected]>
f8a629a
to
165e66e
Compare
Use unified configuration procedure. Signed-off-by: Philippe Guibert <[email protected]>
to help identify the file type. And apply black. Signed-off-by: Louis Scalbert <[email protected]>
Multiple BMP tests can run in parallel but, when one instance ends, it kills the BMP server process of all BMP tests. Save the PID of a BMP server and only kill it at the end. Link: FRRouting#17465 Fixes: 875511c ("topotests: add basic bmp collector") Signed-off-by: Louis Scalbert <[email protected]>
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]>
…/tmp Some temporary files are hardwritten in /tmp folder. Use the bmp log folder instead. Replace the bmp log file argument with bmp log folder. Signed-off-by: Philippe Guibert <[email protected]>
165e66e
to
d1301f1
Compare
See individual commits:
The BMP tests use a common library that is duplicate in bgp_bmp and bgp_bmp_vrf test.
Gather the two tests in one, and benefit from the same code.
When testing with an iBGP peering, a fix has been found in current BMP collector implementation regarding the read of the BGP as path attribute. Fix it too.
Protection against killing of undesirable bmp collector when testing multiple bmp tests in parallel: BMPServer in topotests should not
pkill -f bmpserver
#17465