diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-12-03 15:48:26 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2024-12-05 15:42:10 +0100 |
| commit | f921a8d09ac352f843ef3551a0eb268f7dd17de3 (patch) | |
| tree | 88f4e167e45b78d852daa4d8985d5651f8f1d0f5 | |
| parent | 013b9d4c19ef5e7ce8bb307c13ab9e0fc955c7aa (diff) | |
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>
| -rw-r--r-- | tests/topotests/bgp_bmp/bgpbmp.py | 15 | ||||
| -rw-r--r-- | tests/topotests/bgp_bmp/test_bgp_bmp_1.py | 2 | ||||
| -rw-r--r-- | tests/topotests/bgp_bmp/test_bgp_bmp_2.py | 2 |
3 files changed, 12 insertions, 7 deletions
diff --git a/tests/topotests/bgp_bmp/bgpbmp.py b/tests/topotests/bgp_bmp/bgpbmp.py index 41995e2b5e..5e8b0d9be7 100644 --- a/tests/topotests/bgp_bmp/bgpbmp.py +++ b/tests/topotests/bgp_bmp/bgpbmp.py @@ -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: diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp_1.py b/tests/topotests/bgp_bmp/test_bgp_bmp_1.py index 6142863441..be3e07929a 100644 --- a/tests/topotests/bgp_bmp/test_bgp_bmp_1.py +++ b/tests/topotests/bgp_bmp/test_bgp_bmp_1.py @@ -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") diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp_2.py b/tests/topotests/bgp_bmp/test_bgp_bmp_2.py index b45452e7c4..e8f67515bd 100644 --- a/tests/topotests/bgp_bmp/test_bgp_bmp_2.py +++ b/tests/topotests/bgp_bmp/test_bgp_bmp_2.py @@ -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") |
