From e7adf2762fcb334219e26ce2971255525006a2a3 Mon Sep 17 00:00:00 2001 From: Farid MIHOUB Date: Fri, 11 Aug 2023 16:18:17 +0200 Subject: [PATCH] tests: extend the bmp test to support bmp loc-rib Configure the bmp monitor unicast loc-rib. Check the logging messages for the updated/withdrawn prefixes with the presence of the loc-rib peer-type. Signed-off-by: Farid MIHOUB --- tests/topotests/bgp_bmp/test_bgp_bmp.py | 3 +++ tests/topotests/lib/bmp_collector/bmp.py | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp.py b/tests/topotests/bgp_bmp/test_bgp_bmp.py index 1aeb2d9c19..250f1cb90d 100644 --- a/tests/topotests/bgp_bmp/test_bgp_bmp.py +++ b/tests/topotests/bgp_bmp/test_bgp_bmp.py @@ -49,6 +49,7 @@ SEQ = 0 PRE_POLICY = "pre-policy" POST_POLICY = "post-policy" +LOC_RIB = "loc-rib" def build_topo(tgen): @@ -239,6 +240,8 @@ def test_bmp_bgp_unicast(): unicast_prefixes(PRE_POLICY) logger.info("*** Unicast prefixes post-policy logging ***") unicast_prefixes(POST_POLICY) + logger.info("*** Unicast prefixes loc-rib logging ***") + unicast_prefixes(LOC_RIB) if __name__ == "__main__": diff --git a/tests/topotests/lib/bmp_collector/bmp.py b/tests/topotests/lib/bmp_collector/bmp.py index 4ac4fdb0a9..57f642aa0e 100644 --- a/tests/topotests/lib/bmp_collector/bmp.py +++ b/tests/topotests/lib/bmp_collector/bmp.py @@ -252,6 +252,7 @@ class BMPPerPeerMessage: if peer_type == 0x03: msg['is_filtered'] = bool(peer_flags & IS_FILTERED) + msg['policy'] = 'loc-rib' else: # peer_flags = 0x0000 0000 # ipv6, post-policy, as-path, adj-rib-out, reserverdx4 -- 2.39.5