mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 10:37:29 +00:00
tests: Static route cases with admin dist and tag.
1. Adding api to verify ip nht command. 2. 5 cases of static routes with admin dist and tag 3. Run time = 89Secs Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
This commit is contained in:
parent
f10f8f0e98
commit
26bbe9af5e
@ -4333,3 +4333,58 @@ def kill_iperf(tgen, dut=None, action=None):
|
|||||||
rnode.run(cmd)
|
rnode.run(cmd)
|
||||||
|
|
||||||
logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
|
logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
|
||||||
|
|
||||||
|
|
||||||
|
def verify_ip_nht(tgen, input_dict):
|
||||||
|
"""
|
||||||
|
Running "show ip nht" command and verifying given nexthop resolution
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
* `tgen` : topogen object
|
||||||
|
* `input_dict`: data to verify nexthop
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
input_dict_4 = {
|
||||||
|
"r1": {
|
||||||
|
nh: {
|
||||||
|
"Address": nh,
|
||||||
|
"resolvedVia": "connected",
|
||||||
|
"nexthops": {
|
||||||
|
"nexthop1": {
|
||||||
|
"Interface": intf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result = verify_ip_nht(tgen, input_dict_4)
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
errormsg(str) or True
|
||||||
|
"""
|
||||||
|
|
||||||
|
logger.debug("Entering lib API: verify_ip_nht()")
|
||||||
|
|
||||||
|
for router in input_dict.keys():
|
||||||
|
if router not in tgen.routers():
|
||||||
|
continue
|
||||||
|
|
||||||
|
rnode = tgen.routers()[router]
|
||||||
|
nh_list = input_dict[router]
|
||||||
|
|
||||||
|
if validate_ip_address(nh_list.keys()[0]) is "ipv6":
|
||||||
|
show_ip_nht = run_frr_cmd(rnode, "show ipv6 nht")
|
||||||
|
else:
|
||||||
|
show_ip_nht = run_frr_cmd(rnode, "show ip nht")
|
||||||
|
|
||||||
|
for nh in nh_list:
|
||||||
|
if nh in show_ip_nht:
|
||||||
|
logger.info("Nexthop %s is resolved on %s", nh, router)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
errormsg = "Nexthop {} is resolved on {}".format(nh, router)
|
||||||
|
return errormsg
|
||||||
|
|
||||||
|
logger.debug("Exiting lib API: verify_ip_nht()")
|
||||||
|
return False
|
||||||
|
|
||||||
|
@ -0,0 +1,189 @@
|
|||||||
|
{
|
||||||
|
"address_types": [
|
||||||
|
"ipv4",
|
||||||
|
"ipv6"
|
||||||
|
],
|
||||||
|
"ipv4base": "10.0.0.0",
|
||||||
|
"ipv4mask": 30,
|
||||||
|
"ipv6base": "fd00::",
|
||||||
|
"ipv6mask": 64,
|
||||||
|
"link_ip_start": {
|
||||||
|
"ipv4": "10.0.0.0",
|
||||||
|
"v4mask": 29,
|
||||||
|
"ipv6": "fd00::",
|
||||||
|
"v6mask": 64
|
||||||
|
},
|
||||||
|
"lo_prefix": {
|
||||||
|
"ipv4": "1.0.",
|
||||||
|
"v4mask": 32,
|
||||||
|
"ipv6": "2001:db8:f::",
|
||||||
|
"v6mask": 128
|
||||||
|
},
|
||||||
|
"routers": {
|
||||||
|
"r1": {
|
||||||
|
"links": {
|
||||||
|
"lo": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto",
|
||||||
|
"type": "loopback"
|
||||||
|
},
|
||||||
|
"r2-link0": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r2-link1": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r2-link2": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r2-link3": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r2-link4": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r2-link5": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r2-link6": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r2-link7": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"r2": {
|
||||||
|
"links": {
|
||||||
|
"lo": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto",
|
||||||
|
"type": "loopback"
|
||||||
|
},
|
||||||
|
"r1-link0": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r1-link1": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r1-link2": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r1-link3": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r1-link4": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r1-link5": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r1-link6": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r1-link7": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
},
|
||||||
|
"r3-link0": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bgp": {
|
||||||
|
"local_as": "100",
|
||||||
|
"address_family": {
|
||||||
|
"ipv4": {
|
||||||
|
"unicast": {
|
||||||
|
"neighbor": {
|
||||||
|
"r3": {
|
||||||
|
"dest_link": {
|
||||||
|
"r2-link0": {
|
||||||
|
"keepalivetimer": 1,
|
||||||
|
"holddowntimer": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ipv6": {
|
||||||
|
"unicast": {
|
||||||
|
"neighbor": {
|
||||||
|
"r3": {
|
||||||
|
"dest_link": {
|
||||||
|
"r2-link0": {
|
||||||
|
"keepalivetimer": 1,
|
||||||
|
"holddowntimer": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"r3": {
|
||||||
|
"links": {
|
||||||
|
"lo": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto",
|
||||||
|
"type": "loopback"
|
||||||
|
},
|
||||||
|
"r2-link0": {
|
||||||
|
"ipv4": "auto",
|
||||||
|
"ipv6": "auto"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bgp": {
|
||||||
|
"local_as": "200",
|
||||||
|
"address_family": {
|
||||||
|
"ipv4": {
|
||||||
|
"unicast": {
|
||||||
|
"neighbor": {
|
||||||
|
"r2": {
|
||||||
|
"dest_link": {
|
||||||
|
"r3-link0": {
|
||||||
|
"keepalivetimer": 1,
|
||||||
|
"holddowntimer": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ipv6": {
|
||||||
|
"unicast": {
|
||||||
|
"neighbor": {
|
||||||
|
"r2": {
|
||||||
|
"dest_link": {
|
||||||
|
"r3-link0": {
|
||||||
|
"keepalivetimer": 1,
|
||||||
|
"holddowntimer": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user