From 41077aa1915fb12627a875b7e1839e24c87bca77 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Sat, 25 Aug 2018 18:46:46 +0200 Subject: lib/ospf-topo1-vrf: don't compare headers of show ip route Signed-off-by: Christian Franke --- tests/topotests/lib/topotest.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/topotests/lib/topotest.py') diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 5cc222e149..d1985b008e 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -425,7 +425,15 @@ def ip4_route_zebra(node, vrf_name=None): 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 + + lines = output.splitlines() + header_found = False + while lines and (not strip(lines[0]) + or not header_found): + if '> - selected route' in lines[0]: + header_found = True + lines = lines[1:] + return '\n'.join(lines) def ip4_route(node): """ -- cgit v1.2.3