mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 20:51:17 +00:00
tests: SRv6 SID Manager check ping
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit is contained in:
parent
d157212a21
commit
1168c5a747
@ -264,6 +264,22 @@ def router_compare_json_output(rname, command, reference):
|
||||
assert diff is None, assertmsg
|
||||
|
||||
|
||||
def check_ping6(name, dest_addr, expect_connected):
|
||||
def _check(name, dest_addr, match):
|
||||
tgen = get_topogen()
|
||||
output = tgen.gears[name].run("ping6 {} -c 1 -w 1".format(dest_addr))
|
||||
logger.info(output)
|
||||
if match not in output:
|
||||
return "ping fail"
|
||||
|
||||
match = "{} packet loss".format("0%" if expect_connected else "100%")
|
||||
logger.info("[+] check {} {} {}".format(name, dest_addr, match))
|
||||
tgen = get_topogen()
|
||||
func = functools.partial(_check, name, dest_addr, match)
|
||||
success, result = topotest.run_and_expect(func, None, count=10, wait=1)
|
||||
assert result is None, "Failed"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = ["-s"] + sys.argv[1:]
|
||||
sys.exit(pytest.main(args))
|
||||
|
Loading…
Reference in New Issue
Block a user