diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-12-19 08:58:02 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2025-01-07 15:35:31 +0100 |
commit | 2bd5cd1b81a91dc6f38547f75b74e97f4e9ea5e9 (patch) | |
tree | 0d15c444dad3cea51e59d7ccab1edcfc3b22e5f2 /tests | |
parent | bgpd, topotests: bmp, add loc-rib peer up event for imported bgp (diff) | |
download | frr-2bd5cd1b81a91dc6f38547f75b74e97f4e9ea5e9.tar.xz frr-2bd5cd1b81a91dc6f38547f75b74e97f4e9ea5e9.zip |
bgpd, topotests: bmp imported bgp, add loc-rib peer up support when router-id changes
Add the emission of a loc-rib peer up event for an imported bgp instance
at route-id reconfiguration. Add a test to control in the BMP collector
that the peer up message is the one from that BGP instance.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/topotests/bgp_bmp/test_bgp_bmp_3.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp_3.py b/tests/topotests/bgp_bmp/test_bgp_bmp_3.py index 088f4cb45..06d9f1f9e 100644 --- a/tests/topotests/bgp_bmp/test_bgp_bmp_3.py +++ b/tests/topotests/bgp_bmp/test_bgp_bmp_3.py @@ -263,6 +263,57 @@ def test_peer_down(): assert success, "Checking the updated prefixes has been failed !." +def test_bgp_routerid_changed(): + """ + Checking for BGP loc-rib up messages with new router-id + """ + tgen = get_topogen() + + tgen.gears["r1import"].vtysh_cmd( + """ + configure terminal + router bgp 65501 vrf vrf1 + bgp router-id 192.168.1.77 + """ + ) + + peers = ["0.0.0.0"] + + logger.info( + "checking for BMP peer down LOC-RIB message with router-id set to 192.168.0.1." + ) + test_func = partial( + bmp_check_for_peer_message, + peers, + "peer down", + tgen.gears["bmp1import"], + os.path.join(tgen.logdir, "bmp1import", "bmp.log"), + is_rd_instance=True, + peer_bgp_id="192.168.0.1", + ) + success, _ = topotest.run_and_expect(test_func, True, count=30, wait=1) + assert ( + success + ), "Checking the BMP peer down LOC-RIB message with router-id set to 192.168.0.1 failed !." + + logger.info( + "checking for BMP peer up LOC-RIB message with router-id set to 192.168.1.77." + ) + test_func = partial( + bmp_check_for_peer_message, + peers, + "peer up", + tgen.gears["bmp1import"], + os.path.join(tgen.logdir, "bmp1import", "bmp.log"), + is_rd_instance=True, + peer_bgp_id="192.168.1.77", + ) + success, _ = topotest.run_and_expect(test_func, True, count=30, wait=1) + assert ( + success + ), "Checking the BMP peer up LOC-RIB message with router-id set to 192.168.1.77 failed !." + + if __name__ == "__main__": args = ["-s"] + sys.argv[1:] sys.exit(pytest.main(args)) |