Merge pull request #8165 from wesleycoakley/misc-qol-fixups

staticd, pimd, tests: small fixups and cov fix
This commit is contained in:
Rafael Zalamena 2021-03-05 11:22:47 +00:00 committed by GitHub
commit ee56932473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 10 deletions

View File

@ -6057,7 +6057,7 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
vty_out(vty, vty_out(vty,
" R - SGRpt Pruned, F - Register flag, T - SPT-bit set\n"); " R - SGRpt Pruned, F - Register flag, T - SPT-bit set\n");
vty_out(vty, vty_out(vty,
"\nSource Group Flags Proto Input Output TTL Uptime\n"); "\nSource Group Flags Proto Input Output TTL Uptime\n");
} }
now = pim_time_monotonic_sec(); now = pim_time_monotonic_sec();
@ -6247,7 +6247,7 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
} }
vty_out(vty, vty_out(vty,
"%-15s %-15s %-15s %-6s %-16s %-16s %-3d %8s\n", "%-15s %-15s %-8s %-6s %-16s %-16s %-3d %8s\n",
src_str, grp_str, state_str, proto, src_str, grp_str, state_str, proto,
in_ifname, out_ifname, ttl, in_ifname, out_ifname, ttl,
mroute_uptime); mroute_uptime);

View File

@ -294,8 +294,11 @@ static int static_route_leak(struct vty *vty, const char *svrf,
buf_gate_str, ifname); buf_gate_str, ifname);
dnode = yang_dnode_get(vty->candidate_config->dnode, ab_xpath); dnode = yang_dnode_get(vty->candidate_config->dnode, ab_xpath);
if (!dnode) if (!dnode) {
vty_out(vty,
"%% Refusing to remove a non-existent route\n");
return ret; return ret;
}
dnode = yang_get_subtree_with_no_sibling(dnode); dnode = yang_get_subtree_with_no_sibling(dnode);
assert(dnode); assert(dnode);

View File

@ -3880,6 +3880,7 @@ def verify_attributes_for_evpn_routes(
return errormsg return errormsg
if rt == "auto": if rt == "auto":
vni_dict = {}
logger.info( logger.info(
"[DUT: %s]: Verifying auto-rt value for " "evpn route %s:", "[DUT: %s]: Verifying auto-rt value for " "evpn route %s:",
dut, dut,
@ -3887,8 +3888,6 @@ def verify_attributes_for_evpn_routes(
) )
if rt_peer: if rt_peer:
vni_dict = {}
rnode = tgen.routers()[rt_peer] rnode = tgen.routers()[rt_peer]
show_bgp_json = run_frr_cmd( show_bgp_json = run_frr_cmd(
rnode, "show bgp vrf all summary json", isjson=True rnode, "show bgp vrf all summary json", isjson=True

View File

@ -336,16 +336,15 @@ def start_router_daemons(tgen, router, daemons):
router_list = tgen.routers() router_list = tgen.routers()
# Start daemons # Start daemons
result = router_list[router].startDaemons(daemons) res = router_list[router].startDaemons(daemons)
return result
except Exception as e: except Exception as e:
errormsg = traceback.format_exc() errormsg = traceback.format_exc()
logger.error(errormsg) logger.error(errormsg)
return errormsg res = errormsg
logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name)) logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
return True return res
def kill_mininet_routers_process(tgen): def kill_mininet_routers_process(tgen):
@ -1376,12 +1375,14 @@ def generate_ips(network, no_of_ips):
return ipaddress_list return ipaddress_list
start_ip = ipaddress.IPv4Address(unicode(start_ip)) start_ip = ipaddress.IPv4Address(unicode(start_ip))
step = 2 ** (32 - mask) step = 2 ** (32 - mask)
if addr_type == "ipv6": elif addr_type == "ipv6":
if start_ip == "0::0" and mask == 0 and no_of_ips == 1: if start_ip == "0::0" and mask == 0 and no_of_ips == 1:
ipaddress_list.append("{}/{}".format(start_ip, mask)) ipaddress_list.append("{}/{}".format(start_ip, mask))
return ipaddress_list return ipaddress_list
start_ip = ipaddress.IPv6Address(unicode(start_ip)) start_ip = ipaddress.IPv6Address(unicode(start_ip))
step = 2 ** (128 - mask) step = 2 ** (128 - mask)
else:
return []
next_ip = start_ip next_ip = start_ip
count = 0 count = 0