diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-07-20 16:22:38 +0200 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-11-27 20:22:14 -0500 |
| commit | b220b3c83a71463323f4e3debc5cb207eb7d1bec (patch) | |
| tree | ed7c698dcad35ca48dc588abc1990d866e9387df /tests/topotests/lib/topotest.py | |
| parent | 35490676ebfd85c2093358fcb53c73b9e502b367 (diff) | |
lib: add ip_route_zebra function
This command permits dumping zebra routes from a vrf
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'tests/topotests/lib/topotest.py')
| -rw-r--r-- | tests/topotests/lib/topotest.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index bf3cfe5322..84b185d7ea 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -404,6 +404,18 @@ def version_cmp(v1, v2): return -1 return 0 +def ip4_route_zebra(node, vrf_name=None): + """ + Gets an output of 'show ip route' command. It can be used + with comparing the output to a reference + """ + if vrf_name == None: + tmp = node.vtysh_cmd('show ip route') + else: + tmp = node.vtysh_cmd('show ip route vrf {0}'.format(vrf_name)) + output = re.sub(r" [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", " XX:XX:XX", tmp) + return output + def ip4_route(node): """ Gets a structured return of the command 'ip route'. It can be used in |
