summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_snmp_bgp4.c4
-rw-r--r--bgpd/bgp_updgrp.c5
-rw-r--r--bgpd/bgpd.h3
-rw-r--r--doc/user/vtysh.rst5
-rw-r--r--ospfd/ospf_snmp.c26
-rw-r--r--tests/topotests/lib/bgp.py30
-rw-r--r--tests/topotests/multicast_mld_join_topo1/test_multicast_mld_local_join.py27
-rw-r--r--tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm1.py37
-rw-r--r--tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm2.py17
-rw-r--r--tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py48
-rw-r--r--tests/topotests/multicast_pim_uplink_topo2/test_multicast_pim_uplink_topo2.py38
-rw-r--r--tests/topotests/multicast_pim_uplink_topo3/test_multicast_pim_uplink_topo3.py26
12 files changed, 228 insertions, 38 deletions
diff --git a/bgpd/bgp_snmp_bgp4.c b/bgpd/bgp_snmp_bgp4.c
index 0c391b621e..692e232a83 100644
--- a/bgpd/bgp_snmp_bgp4.c
+++ b/bgpd/bgp_snmp_bgp4.c
@@ -401,7 +401,7 @@ static struct bgp_path_info *bgp4PathAttrLookup(struct variable *v, oid name[],
/* Set OID offset for prefix. */
offset = name + v->namelen;
oid2in_addr(offset, IN_ADDR_SIZE, &addr->prefix);
- offset += IN_ADDR_SIZE;
+ offset++;
/* Prefix length. */
addr->prefixlen = *offset;
@@ -497,7 +497,7 @@ static struct bgp_path_info *bgp4PathAttrLookup(struct variable *v, oid name[],
offset = name + v->namelen;
oid_copy_in_addr(offset, &rn_p->u.prefix4);
- offset += IN_ADDR_SIZE;
+ offset++;
*offset = rn_p->prefixlen;
offset++;
oid_copy_in_addr(offset,
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index 701c7aba57..a2006c3508 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -734,7 +734,8 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
safi2str(updgrp->safi));
} else {
vty_out(vty, "Update-group %" PRIu64 ":\n", updgrp->id);
- vty_out(vty, " Created: %s", timestamp_string(updgrp->uptime));
+ vty_out(vty, " Created: %s",
+ timestamp_string(updgrp->uptime, timebuf));
}
filter = &updgrp->conf->filter[updgrp->afi][updgrp->safi];
@@ -803,7 +804,7 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
vty_out(vty, " Update-subgroup %" PRIu64 ":\n",
subgrp->id);
vty_out(vty, " Created: %s",
- timestamp_string(subgrp->uptime));
+ timestamp_string(subgrp->uptime, timebuf));
}
if (subgrp->split_from.update_group_id
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index b80e0e787b..ca1411a3b1 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -2595,10 +2595,9 @@ static inline int peer_group_af_configured(struct peer_group *group)
return 0;
}
-static inline char *timestamp_string(time_t ts)
+static inline char *timestamp_string(time_t ts, char *timebuf)
{
time_t tbuf;
- char timebuf[32];
tbuf = time(NULL) - (monotime(NULL) - ts);
return ctime_r(&tbuf, timebuf);
diff --git a/doc/user/vtysh.rst b/doc/user/vtysh.rst
index 1ab54f09ab..adbdf3451a 100644
--- a/doc/user/vtysh.rst
+++ b/doc/user/vtysh.rst
@@ -18,8 +18,9 @@ administrator with an external editor.
.. warning::
- This also means the ``hostname`` and ``banner motd`` commands (which both do
- have effect for vtysh) need to be manually updated in :file:`vtysh.conf`.
+ This also means the ``hostname``, ``domainname``, and ``banner motd`` commands
+ (which do have effect for vtysh) need to be manually updated
+ in :file:`vtysh.conf`.
.. clicmd:: copy FILENAME running-config
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index fcc43e7311..c9aaa9f978 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -906,7 +906,7 @@ static struct ospf_lsa *ospfLsdbLookup(struct variable *v, oid *name,
area = ospf_area_lookup_by_area_id(ospf, *area_id);
if (!area)
return NULL;
- offset += IN_ADDR_SIZE;
+ offset++;
/* Type. */
*type = *offset;
@@ -914,7 +914,7 @@ static struct ospf_lsa *ospfLsdbLookup(struct variable *v, oid *name,
/* LS ID. */
oid2in_addr(offset, IN_ADDR_SIZE, ls_id);
- offset += IN_ADDR_SIZE;
+ offset++;
/* Router ID. */
oid2in_addr(offset, IN_ADDR_SIZE, router_id);
@@ -971,7 +971,7 @@ static struct ospf_lsa *ospfLsdbLookup(struct variable *v, oid *name,
}
/* Router ID. */
- offset += IN_ADDR_SIZE;
+ offset++;
offsetlen -= IN_ADDR_SIZE;
len = offsetlen;
@@ -996,11 +996,11 @@ static struct ospf_lsa *ospfLsdbLookup(struct variable *v, oid *name,
/* Fill in value. */
offset = name + v->namelen;
oid_copy_in_addr(offset, area_id);
- offset += IN_ADDR_SIZE;
+ offset++;
*offset = lsa->data->type;
offset++;
oid_copy_in_addr(offset, &lsa->data->id);
- offset += IN_ADDR_SIZE;
+ offset++;
oid_copy_in_addr(offset,
&lsa->data->adv_router);
@@ -1106,7 +1106,7 @@ static struct ospf_area_range *ospfAreaRangeLookup(struct variable *v,
if (!area)
return NULL;
- offset += IN_ADDR_SIZE;
+ offset++;
/* Lookup area range. */
oid2in_addr(offset, IN_ADDR_SIZE, range_net);
@@ -1135,7 +1135,7 @@ static struct ospf_area_range *ospfAreaRangeLookup(struct variable *v,
return NULL;
do {
- offset += IN_ADDR_SIZE;
+ offset++;
offsetlen -= IN_ADDR_SIZE;
len = offsetlen;
@@ -1157,7 +1157,7 @@ static struct ospf_area_range *ospfAreaRangeLookup(struct variable *v,
/* Fill in value. */
offset = name + v->namelen;
oid_copy_in_addr(offset, area_id);
- offset += IN_ADDR_SIZE;
+ offset++;
oid_copy_in_addr(offset, range_net);
return range;
@@ -1560,7 +1560,7 @@ static struct ospf_interface *ospfIfLookup(struct variable *v, oid *name,
*length = v->namelen + IN_ADDR_SIZE + 1;
offset = name + v->namelen;
oid_copy_in_addr(offset, ifaddr);
- offset += IN_ADDR_SIZE;
+ offset++;
*offset = *ifindex;
return oi;
}
@@ -1704,7 +1704,7 @@ static struct ospf_interface *ospfIfMetricLookup(struct variable *v, oid *name,
*length = v->namelen + IN_ADDR_SIZE + 1 + 1;
offset = name + v->namelen;
oid_copy_in_addr(offset, ifaddr);
- offset += IN_ADDR_SIZE;
+ offset++;
*offset = *ifindex;
offset++;
*offset = OSPF_SNMP_METRIC_VALUE;
@@ -2242,7 +2242,7 @@ static struct ospf_lsa *ospfExtLsdbLookup(struct variable *v, oid *name,
/* LS ID. */
oid2in_addr(offset, IN_ADDR_SIZE, ls_id);
- offset += IN_ADDR_SIZE;
+ offset++;
/* Router ID. */
oid2in_addr(offset, IN_ADDR_SIZE, router_id);
@@ -2270,7 +2270,7 @@ static struct ospf_lsa *ospfExtLsdbLookup(struct variable *v, oid *name,
oid2in_addr(offset, len, ls_id);
- offset += IN_ADDR_SIZE;
+ offset++;
offsetlen -= IN_ADDR_SIZE;
/* Router ID. */
@@ -2293,7 +2293,7 @@ static struct ospf_lsa *ospfExtLsdbLookup(struct variable *v, oid *name,
*offset = OSPF_AS_EXTERNAL_LSA;
offset++;
oid_copy_in_addr(offset, &lsa->data->id);
- offset += IN_ADDR_SIZE;
+ offset++;
oid_copy_in_addr(offset, &lsa->data->adv_router);
return lsa;
diff --git a/tests/topotests/lib/bgp.py b/tests/topotests/lib/bgp.py
index 21d4567d6b..3a16ed5a09 100644
--- a/tests/topotests/lib/bgp.py
+++ b/tests/topotests/lib/bgp.py
@@ -1325,7 +1325,7 @@ def verify_router_id(tgen, topo, input_dict, expected=True):
@retry(retry_timeout=150)
-def verify_bgp_convergence(tgen, topo=None, dut=None, expected=True):
+def verify_bgp_convergence(tgen, topo=None, dut=None, expected=True, addr_type=None):
"""
API will verify if BGP is converged with in the given time frame.
Running "show bgp summary json" command and verify bgp neighbor
@@ -1336,6 +1336,7 @@ def verify_bgp_convergence(tgen, topo=None, dut=None, expected=True):
* `tgen`: topogen object
* `topo`: input json file data
* `dut`: device under test
+ * `addr_type` : address type for which verification to be done, by-default both v4 and v6
Usage
-----
@@ -1439,20 +1440,27 @@ def verify_bgp_convergence(tgen, topo=None, dut=None, expected=True):
return errormsg
else:
total_peer = 0
- for addr_type in bgp_addr_type.keys():
- if not check_address_types(addr_type):
+ for _addr_type in bgp_addr_type.keys():
+ if not check_address_types(_addr_type):
+ continue
+
+ if addr_type and addr_type != _addr_type:
continue
- bgp_neighbors = bgp_addr_type[addr_type]["unicast"]["neighbor"]
+ bgp_neighbors = bgp_addr_type[_addr_type]["unicast"]["neighbor"]
for bgp_neighbor in bgp_neighbors:
total_peer += len(bgp_neighbors[bgp_neighbor]["dest_link"])
no_of_peer = 0
- for addr_type in bgp_addr_type.keys():
+ for _addr_type in bgp_addr_type.keys():
if not check_address_types(addr_type):
continue
- bgp_neighbors = bgp_addr_type[addr_type]["unicast"]["neighbor"]
+
+ if addr_type and addr_type != _addr_type:
+ continue
+
+ bgp_neighbors = bgp_addr_type[_addr_type]["unicast"]["neighbor"]
for bgp_neighbor, peer_data in bgp_neighbors.items():
for dest_link in peer_data["dest_link"].keys():
@@ -1473,7 +1481,7 @@ def verify_bgp_convergence(tgen, topo=None, dut=None, expected=True):
elif "source_link" in peer_details:
neighbor_ip = topo["routers"][bgp_neighbor][
"links"
- ][peer_details["source_link"]][addr_type].split(
+ ][peer_details["source_link"]][_addr_type].split(
"/"
)[
0
@@ -1484,12 +1492,12 @@ def verify_bgp_convergence(tgen, topo=None, dut=None, expected=True):
):
neighbor_ip = data[dest_link]["peer-interface"]
else:
- neighbor_ip = data[dest_link][addr_type].split("/")[
- 0
- ]
+ neighbor_ip = data[dest_link][_addr_type].split(
+ "/"
+ )[0]
nh_state = None
neighbor_ip = neighbor_ip.lower()
- if addr_type == "ipv4":
+ if _addr_type == "ipv4":
ipv4_data = show_bgp_json[vrf]["ipv4Unicast"][
"peers"
]
diff --git a/tests/topotests/multicast_mld_join_topo1/test_multicast_mld_local_join.py b/tests/topotests/multicast_mld_join_topo1/test_multicast_mld_local_join.py
index 826d6e2941..84a13aedee 100644
--- a/tests/topotests/multicast_mld_join_topo1/test_multicast_mld_local_join.py
+++ b/tests/topotests/multicast_mld_join_topo1/test_multicast_mld_local_join.py
@@ -42,6 +42,10 @@ from lib.pim import (
verify_pim_rp_info,
verify_upstream_iif,
)
+from lib.bgp import (
+ verify_bgp_convergence,
+)
+
from lib.topogen import Topogen, get_topogen
from lib.topojson import build_config_from_json
from lib.topolog import logger
@@ -126,6 +130,13 @@ def setup_module(mod):
# Creating configuration from JSON
build_config_from_json(tgen, topo)
+
+ # Verify BGP convergence
+ BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
+ BGP_CONVERGENCE
+ )
+
# Verify PIM neighbors
result = verify_pim_neighbors(tgen, topo)
assert result is True, " Verify PIM neighbor: Failed Error: {}".format(result)
@@ -177,6 +188,10 @@ def test_mld_local_joins_p0(request):
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
step("configure BGP on R1, R2, R3, R4 and enable redistribute static/connected")
step("Enable the MLD on R11 interfac of R1 and configure local mld groups")
intf_r1_i1 = topo["routers"]["r1"]["links"]["i1"]["interface"]
@@ -249,6 +264,10 @@ def test_mroute_with_mld_local_joins_p0(request):
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
step("Enable the PIM on all the interfaces of R1, R2, R3, R4")
@@ -442,6 +461,10 @@ def test_remove_add_mld_local_joins_p1(request):
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
step("Enable the PIM on all the interfaces of R1, R2, R3, R4")
@@ -694,6 +717,10 @@ def test_remove_add_mld_config_with_local_joins_p1(request):
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
step("Enable the PIM on all the interfaces of R1, R2, R3, R4")
diff --git a/tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm1.py b/tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm1.py
index aff623705c..7eb5838037 100644
--- a/tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm1.py
+++ b/tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm1.py
@@ -61,6 +61,9 @@ from lib.pim import (
verify_sg_traffic,
verify_upstream_iif,
)
+from lib.bgp import (
+ verify_bgp_convergence,
+)
from lib.topogen import Topogen, get_topogen
from lib.topojson import build_config_from_json
from lib.topolog import logger
@@ -140,6 +143,12 @@ def setup_module(mod):
global app_helper
app_helper = McastTesterHelper(tgen)
+ # Verify BGP convergence
+ BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
+ BGP_CONVERGENCE
+ )
+
logger.info("Running setup_module() done")
@@ -276,6 +285,10 @@ def test_multicast_data_traffic_static_RP_send_traffic_then_join_p0(request):
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
# Don"t run this test if we have any failure.
@@ -480,6 +493,10 @@ def test_verify_mroute_when_receiver_is_outside_frr_p0(request):
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -648,6 +665,10 @@ def test_verify_mroute_when_frr_is_transit_router_p2(request):
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
# Don"t run this test if we have any failure.
@@ -803,6 +824,10 @@ def test_verify_mroute_when_RP_unreachable_p1(request):
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
# Don"t run this test if we have any failure.
@@ -929,6 +954,10 @@ def test_modify_mld_query_timer_p0(request):
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
# Don"t run this test if we have any failure.
@@ -1108,6 +1137,10 @@ def test_modify_mld_max_query_response_timer_p0(request):
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
# Don"t run this test if we have any failure.
@@ -1377,6 +1410,10 @@ def test_verify_impact_on_multicast_traffic_when_RP_removed_p0(request):
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
# Don"t run this test if we have any failure.
diff --git a/tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm2.py b/tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm2.py
index 767264a7c0..8b174bf9b8 100644
--- a/tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm2.py
+++ b/tests/topotests/multicast_pim6_sm_topo1/test_multicast_pim6_sm2.py
@@ -43,6 +43,9 @@ from lib.pim import (
verify_sg_traffic,
verify_upstream_iif,
)
+from lib.bgp import (
+ verify_bgp_convergence,
+)
from lib.topogen import Topogen, get_topogen
from lib.topojson import build_config_from_json
from lib.topolog import logger
@@ -129,6 +132,12 @@ def setup_module(mod):
# Creating configuration from JSON
build_config_from_json(tgen, tgen.json_topo)
+ # Verify BGP convergence
+ BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
+ BGP_CONVERGENCE
+ )
+
logger.info("Running setup_module() done")
@@ -213,6 +222,10 @@ def test_clear_mroute_and_verify_multicast_data_p0(request, app_helper):
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
app_helper.stop_all_hosts()
# Don"t run this test if we have any failure.
@@ -444,6 +457,10 @@ def test_verify_SPT_switchover_when_RPT_and_SPT_path_is_different_p0(
# Creating configuration from JSON
reset_config_on_routers(tgen)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo, addr_type="ipv6")
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
diff --git a/tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py b/tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py
index b50573e775..5728a4d08e 100644
--- a/tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py
+++ b/tests/topotests/multicast_pim_uplink_topo1/test_multicast_pim_uplink_topo1.py
@@ -52,7 +52,10 @@ from lib.common_config import (
create_static_routes,
required_linux_kernel_version,
)
-from lib.bgp import create_router_bgp
+from lib.bgp import (
+ create_router_bgp,
+ verify_bgp_convergence,
+)
from lib.pim import (
create_pim_config,
create_igmp_config,
@@ -152,6 +155,12 @@ def setup_module(mod):
global app_helper
app_helper = McastTesterHelper(tgen)
+ # Verify BGP convergence
+ BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+ assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
+ BGP_CONVERGENCE
+ )
+
logger.info("Running setup_module() done")
@@ -191,7 +200,6 @@ def get_interfaces_names(topo):
"""
for link in range(1, 5):
-
intf = topo["routers"]["r1"]["links"]["r2-link{}".format(link)]["interface"]
r1_r2_links.append(intf)
@@ -401,6 +409,10 @@ def test_mroutes_updated_with_correct_oil_iif_when_receiver_is_in_and_outside_DU
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -795,6 +807,10 @@ def test_mroutes_updated_with_correct_oil_iif_when_source_is_in_and_outside_DUT_
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -1164,6 +1180,10 @@ def test_verify_mroutes_forwarding_p0(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -1478,6 +1498,10 @@ def test_mroutes_updated_correctly_after_source_interface_shut_noshut_p1(request
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -1838,6 +1862,10 @@ def test_mroutes_updated_correctly_after_receiver_interface_shut_noshut_p1(reque
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -2153,6 +2181,10 @@ def test_mroutes_updated_after_sending_IGMP_prune_and_join_p1(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -2412,6 +2444,10 @@ def test_mroutes_updated_after_after_clear_mroute_p1(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -2601,6 +2637,10 @@ def test_mroutes_updated_after_changing_rp_config_p1(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -3067,6 +3107,10 @@ def test_mroutes_after_restart_frr_services_p2(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
diff --git a/tests/topotests/multicast_pim_uplink_topo2/test_multicast_pim_uplink_topo2.py b/tests/topotests/multicast_pim_uplink_topo2/test_multicast_pim_uplink_topo2.py
index eb3246b513..1fb81c0d70 100644
--- a/tests/topotests/multicast_pim_uplink_topo2/test_multicast_pim_uplink_topo2.py
+++ b/tests/topotests/multicast_pim_uplink_topo2/test_multicast_pim_uplink_topo2.py
@@ -23,6 +23,7 @@ import os
import sys
import time
import pytest
+from time import sleep
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -56,6 +57,9 @@ from lib.pim import (
verify_pim_interface_traffic,
McastTesterHelper,
)
+from lib.bgp import (
+ verify_bgp_convergence,
+)
from lib.topolog import logger
from lib.topojson import build_config_from_json
@@ -131,6 +135,12 @@ def setup_module(mod):
global app_helper
app_helper = McastTesterHelper(tgen)
+ # Verify BGP convergence
+ BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+ assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
+ BGP_CONVERGENCE
+ )
+
logger.info("Running setup_module() done")
@@ -170,7 +180,6 @@ def get_interfaces_names(topo):
"""
for link in range(1, 5):
-
intf = topo["routers"]["r1"]["links"]["r2-link{}".format(link)]["interface"]
r1_r2_links.append(intf)
@@ -255,6 +264,10 @@ def test_iif_oil_when_RP_address_changes_from_static_to_BSR_p1(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -418,7 +431,15 @@ def test_iif_oil_when_RP_address_changes_from_static_to_BSR_p1(request):
}
]
}
- },
+ }
+ }
+ result = create_pim_config(tgen, topo, input_dict)
+ assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result)
+
+ # Need to wait for 10 sec to make sure prune is received before below RP change is executed
+ sleep(10)
+
+ input_dict = {
"r5": {
"pim": {
"rp": [
@@ -432,7 +453,6 @@ def test_iif_oil_when_RP_address_changes_from_static_to_BSR_p1(request):
}
},
}
-
result = create_pim_config(tgen, topo, input_dict)
assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result)
@@ -516,6 +536,10 @@ def test_mroute_when_RPT_and_SPT_path_is_different_p1(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -724,6 +748,10 @@ def test_mroutes_updated_with_correct_oil_iif_after_shut_noshut_upstream_interfa
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -1094,6 +1122,10 @@ def test_mroutes_updated_with_correct_oil_iif_after_shut_noshut_downstream_inter
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
diff --git a/tests/topotests/multicast_pim_uplink_topo3/test_multicast_pim_uplink_topo3.py b/tests/topotests/multicast_pim_uplink_topo3/test_multicast_pim_uplink_topo3.py
index 19a8cd0c17..bed2f2f322 100644
--- a/tests/topotests/multicast_pim_uplink_topo3/test_multicast_pim_uplink_topo3.py
+++ b/tests/topotests/multicast_pim_uplink_topo3/test_multicast_pim_uplink_topo3.py
@@ -53,6 +53,9 @@ from lib.pim import (
verify_local_igmp_groups,
McastTesterHelper,
)
+from lib.bgp import (
+ verify_bgp_convergence,
+)
from lib.topolog import logger
from lib.topojson import build_config_from_json
@@ -181,6 +184,12 @@ def setup_module(mod):
global app_helper
app_helper = McastTesterHelper(tgen)
+ # Verify BGP convergence
+ BGP_CONVERGENCE = verify_bgp_convergence(tgen, topo)
+ assert BGP_CONVERGENCE is True, "setup_module : Failed \n Error:" " {}".format(
+ BGP_CONVERGENCE
+ )
+
logger.info("Running setup_module() done")
@@ -220,7 +229,6 @@ def get_interfaces_names(topo):
"""
for link in range(1, 5):
-
intf = topo["routers"]["r1"]["links"]["r2-link{}".format(link)]["interface"]
r1_r2_links.append(intf)
@@ -331,6 +339,10 @@ def test_ip_igmp_local_joins_p0(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -412,6 +424,10 @@ def test_mroute_with_igmp_local_joins_p0(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -606,6 +622,10 @@ def test_igmp_local_join_with_reserved_address_p0(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
@@ -671,6 +691,10 @@ def test_remove_add_igmp_local_joins_p1(request):
reset_config_on_routers(tgen)
clear_pim_interface_traffic(tgen, topo)
+ # Verify BGP convergence
+ result = verify_bgp_convergence(tgen, topo)
+ assert result is True, "Testcase {} : Failed \n Error {}".format(tc_name, result)
+
# Don"t run this test if we have any failure.
if tgen.routers_have_failure():
pytest.skip(tgen.errors)