forked from Mirror/frr
tests: Fix for multicast_pim_bsm_topo1 key error
Issue was reported by Donald, we were hitting with key not found error and execution was stopped, which is fixed by this PR. Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
This commit is contained in:
parent
da82615d4b
commit
296b75ed2a
|
@ -3437,8 +3437,23 @@ def verify_rib(
|
||||||
found_hops = [
|
found_hops = [
|
||||||
rib_r["ip"]
|
rib_r["ip"]
|
||||||
for rib_r in rib_routes_json[st_rt][0]["nexthops"]
|
for rib_r in rib_routes_json[st_rt][0]["nexthops"]
|
||||||
|
if "ip" in rib_r
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# If somehow key "ip" is not found in nexthops JSON
|
||||||
|
# then found_hops would be 0, this particular
|
||||||
|
# situation will be handled here
|
||||||
|
if not len(found_hops):
|
||||||
|
errormsg = (
|
||||||
|
"Nexthop {} is Missing for "
|
||||||
|
"route {} in RIB of router {}\n".format(
|
||||||
|
next_hop,
|
||||||
|
st_rt,
|
||||||
|
dut,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return errormsg
|
||||||
|
|
||||||
# Check only the count of nexthops
|
# Check only the count of nexthops
|
||||||
if count_only:
|
if count_only:
|
||||||
if len(next_hop) == len(found_hops):
|
if len(next_hop) == len(found_hops):
|
||||||
|
|
Loading…
Reference in a new issue