mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 07:15:33 +00:00
Merge pull request #12768 from louis-6wind/fix-grep-vpnv4-noretain
tests: do not use exclude grep
This commit is contained in:
commit
b9f352f0ab
@ -134,12 +134,21 @@ def teardown_module(_mod):
|
|||||||
|
|
||||||
|
|
||||||
def router_json_cmp_exact_filter(router, cmd, expected):
|
def router_json_cmp_exact_filter(router, cmd, expected):
|
||||||
# filter out tableVersion, version and nhVrfID
|
output = router.vtysh_cmd(cmd)
|
||||||
output = router.cmd('vtysh -c "{}" | grep -v ersion | grep -v nhVrfId'.format(cmd))
|
|
||||||
logger.info("{}: {}\n{}".format(router.name, cmd, output))
|
logger.info("{}: {}\n{}".format(router.name, cmd, output))
|
||||||
|
|
||||||
json_output = json.loads(output)
|
json_output = json.loads(output)
|
||||||
|
|
||||||
|
# filter out tableVersion, version and nhVrfID
|
||||||
|
json_output.pop("tableVersion")
|
||||||
|
for rd, data in json_output["routes"]["routeDistinguishers"].items():
|
||||||
|
for prefix, attrs in data.items():
|
||||||
|
for attr in attrs:
|
||||||
|
if "nhVrfId" in attr:
|
||||||
|
attr.pop("nhVrfId")
|
||||||
|
if "version" in attr:
|
||||||
|
attr.pop("version")
|
||||||
|
|
||||||
return topotest.json_cmp(json_output, expected, exact=True)
|
return topotest.json_cmp(json_output, expected, exact=True)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user