topotests: bmp, test that loc-rib peer up message is sent

Add a test at startup to ensure that peer up message for loc-rib is
correctly set.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2024-12-03 15:48:26 +01:00
parent 013b9d4c19
commit f921a8d09a
3 changed files with 12 additions and 7 deletions

View File

@ -216,11 +216,16 @@ def bmp_check_for_peer_message(
]
# get the list of pairs (prefix, policy, seq) for the given message type
peers = [
m["peer_ip"]
for m in messages
if "peer_ip" in m.keys() and m["bmp_log_type"] == bmp_log_type
]
peers = []
for m in messages:
if (
"peer_ip" in m.keys()
and m["peer_ip"] != "0.0.0.0"
and m["bmp_log_type"] == bmp_log_type
):
peers.append(m["peer_ip"])
elif m["policy"] == "loc-rib" and m["bmp_log_type"] == bmp_log_type:
peers.append("0.0.0.0")
# check for prefixes
for ep in expected_peers:

View File

@ -192,7 +192,7 @@ def test_peer_up():
"""
tgen = get_topogen()
peers = ["192.168.0.2", "192:168::2"]
peers = ["192.168.0.2", "192:168::2", "0.0.0.0"]
logger.info("checking for BMP peers up messages")

View File

@ -200,7 +200,7 @@ def test_peer_up():
"""
tgen = get_topogen()
peers = ["192.168.0.2", "192:168::2"]
peers = ["192.168.0.2", "192:168::2", "0.0.0.0"]
logger.info("checking for BMP peers up messages")