Skip to content

Commit

Permalink
topotests: bmp, test that loc-rib peer up message is sent
Browse files Browse the repository at this point in the history
Add a test at startup to ensure that peer up message for loc-rib is
correctly set.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Dec 5, 2024
1 parent 013b9d4 commit f921a8d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions tests/topotests/bgp_bmp/bgpbmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_bmp/test_bgp_bmp_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/bgp_bmp/test_bgp_bmp_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit f921a8d

Please sign in to comment.