summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_bmp.c6
-rw-r--r--tests/topotests/bgp_bmp/bgpbmp.py4
-rw-r--r--tests/topotests/bgp_bmp/test_bgp_bmp_2.py2
3 files changed, 5 insertions, 7 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 65a99d75e7..08cfcdb37c 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -474,12 +474,6 @@ static struct stream *bmp_peerstate(struct peer *peer, bool down)
peer_type = bmp_get_peer_type(peer);
if (peer_type == BMP_PEER_TYPE_LOC_RIB_INSTANCE)
is_locrib = true;
- else
- /* TODO: remove this when other RD and local instances supported */
- peer_type = BMP_PEER_TYPE_GLOBAL_INSTANCE;
-
- if (is_locrib == false)
- peer_type = BMP_PEER_TYPE_GLOBAL_INSTANCE;
if (bmp_get_peer_distinguisher(peer->bgp, AFI_UNSPEC, peer_type, &peer_distinguisher)) {
zlog_warn("skipping bmp message for peer %s: can't get peer distinguisher",
diff --git a/tests/topotests/bgp_bmp/bgpbmp.py b/tests/topotests/bgp_bmp/bgpbmp.py
index 0a0a845b3a..4f770ebcd1 100644
--- a/tests/topotests/bgp_bmp/bgpbmp.py
+++ b/tests/topotests/bgp_bmp/bgpbmp.py
@@ -187,7 +187,7 @@ def bmp_check_for_prefixes(
def bmp_check_for_peer_message(
- expected_peers, bmp_log_type, bmp_collector, bmp_log_file
+ expected_peers, bmp_log_type, bmp_collector, bmp_log_file, is_rd_instance=False
):
"""
Check for the presence of a peer up message for the peer
@@ -211,6 +211,8 @@ def bmp_check_for_peer_message(
and m["peer_ip"] != "0.0.0.0"
and m["bmp_log_type"] == bmp_log_type
):
+ if is_rd_instance and m["peer_type"] != "route distinguisher instance":
+ continue
peers.append(m["peer_ip"])
elif m["policy"] == "loc-rib" and m["bmp_log_type"] == bmp_log_type:
peers.append("0.0.0.0")
diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp_2.py b/tests/topotests/bgp_bmp/test_bgp_bmp_2.py
index e8f67515bd..f16ff2b445 100644
--- a/tests/topotests/bgp_bmp/test_bgp_bmp_2.py
+++ b/tests/topotests/bgp_bmp/test_bgp_bmp_2.py
@@ -210,6 +210,7 @@ def test_peer_up():
"peer up",
tgen.gears["bmp1vrf"],
os.path.join(tgen.logdir, "bmp1vrf", "bmp.log"),
+ is_rd_instance=True,
)
success, _ = topotest.run_and_expect(test_func, True, count=30, wait=1)
assert success, "Checking the updated prefixes has been failed !."
@@ -245,6 +246,7 @@ def test_peer_down():
"peer down",
tgen.gears["bmp1vrf"],
os.path.join(tgen.logdir, "bmp1vrf", "bmp.log"),
+ is_rd_instance=True,
)
success, _ = topotest.run_and_expect(test_func, True, count=30, wait=1)
assert success, "Checking the updated prefixes has been failed !."