]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: add ip_route_zebra function
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 20 Jul 2018 14:22:38 +0000 (16:22 +0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:14 +0000 (20:22 -0500)
This command permits dumping zebra routes from a vrf

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
tests/topotests/lib/topotest.py

index bf3cfe5322588936e780b1e0acb1d92f72ea2a8e..84b185d7ea53ba6001c0739bd1cf8b492b289d6d 100644 (file)
@@ -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