mirror_frr/tests/topotests/bgp_bmp
Philippe Guibert 95ccb5d01d bgpd, topotests: bmp, fix wrong peer distinguisher value for peer vrf up/down
When running the bgp_bmp_2 vrf test, peer vrf up/down events from the pre
and post policy are received with a wrong peer distinguisher value.

> {"peer_type": "route distinguisher instance", "policy": "pre-policy",
> "ipv6": true, "peer_ip": "192:168::2", "peer_distinguisher": "0:0",
> "peer_asn": 65502, "peer_bgp_id": "192.168.0.2", "timestamp":
> "2024-10-16 21:59:53.111962", "bmp_log_type": "peer up", "local_ip":
> "192:168::1", "local_port": 179, "remote_port": 50836, "seq": 5}

RFC7854 mentions in 4.2 that if the peer is a "RD Instance Peer", it is
set to the route distinguisher of the particular instance the peer
belongs to.

Fix this by modifying the BMP client, update the peer distinguisher
value by filling the peer distinguisher in the bmp_peerstate function.

> {"peer_type": "route distinguisher instance", "policy": "pre-policy",
> "ipv6": true, "peer_ip": "192:168::2", "peer_distinguisher": "444:1",
> "peer_asn": 65502, "peer_bgp_id": "192.168.0.2", "timestamp":
> "2024-10-16 21:59:53.111962", "bmp_log_type": "peer up", "local_ip":
> "192:168::1", "local_port": 179, "remote_port": 50836, "seq": 5}

Add a test to check that peer_distinguisher value is not 0:0 when an
RD instance is set.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-11 11:48:01 +01:00
..
bmp1 tests: factorize code in bgp_bmp 2024-10-25 14:17:20 +02:00
bmp1vrf bgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events 2024-12-11 11:29:37 +01:00
r1 topotests: bgp_bmp, use unified configuration 2024-12-02 18:44:50 +01:00
r1vrf topotests: bgp_bmp, expose peer_distinguisher in loc-rib 2024-12-11 11:29:37 +01:00
r2 topotests: bgp_bmp, use unified configuration 2024-12-02 18:44:50 +01:00
r2vrf topotests: bgp_bmp, use unified configuration 2024-12-02 18:44:50 +01:00
__init__.py topotests: add basic bgp bmp test 2023-07-12 14:54:06 +02:00
bgpbmp.py bgpd, topotests: bmp, fix wrong peer distinguisher value for peer vrf up/down 2024-12-11 11:48:01 +01:00
test_bgp_bmp_1.py topotests: bmp, test that loc-rib peer up message is sent 2024-12-05 15:42:10 +01:00
test_bgp_bmp_2.py bgpd, topotests: bmp, fix wrong peer type for peer up/down events 2024-12-11 11:47:56 +01:00