From: Christian Franke Date: Sat, 25 Aug 2018 16:46:46 +0000 (+0200) Subject: lib/ospf-topo1-vrf: don't compare headers of show ip route X-Git-Tag: frr-7.1-dev~151^2~27 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=41077aa1915fb12627a875b7e1839e24c87bca77;p=mirror%2Ffrr.git lib/ospf-topo1-vrf: don't compare headers of show ip route Signed-off-by: Christian Franke --- 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): """ diff --git a/tests/topotests/ospf-topo1-vrf/r1/zebraroute.txt b/tests/topotests/ospf-topo1-vrf/r1/zebraroute.txt index a5e957327e..973db543fa 100644 --- a/tests/topotests/ospf-topo1-vrf/r1/zebraroute.txt +++ b/tests/topotests/ospf-topo1-vrf/r1/zebraroute.txt @@ -1,10 +1,3 @@ -Codes: K - kernel route, C - connected, S - static, R - RIP, - O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, - T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, - F - PBR, - > - selected route, * - FIB route - - VRF r1-cust1: O 10.0.1.0/24 [110/10] is directly connected, r1-eth0, XX:XX:XX C>* 10.0.1.0/24 is directly connected, r1-eth0, XX:XX:XX diff --git a/tests/topotests/ospf-topo1-vrf/r1/zebraroutedown.txt b/tests/topotests/ospf-topo1-vrf/r1/zebraroutedown.txt index b6ef09988a..7bdccd0909 100644 --- a/tests/topotests/ospf-topo1-vrf/r1/zebraroutedown.txt +++ b/tests/topotests/ospf-topo1-vrf/r1/zebraroutedown.txt @@ -1,10 +1,3 @@ -Codes: K - kernel route, C - connected, S - static, R - RIP, - O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, - T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, - F - PBR, - > - selected route, * - FIB route - - VRF r1-cust1: O 10.0.1.0/24 [110/10] is directly connected, r1-eth0, XX:XX:XX C>* 10.0.1.0/24 is directly connected, r1-eth0, XX:XX:XX diff --git a/tests/topotests/ospf-topo1-vrf/r2/zebraroute.txt b/tests/topotests/ospf-topo1-vrf/r2/zebraroute.txt index d079c62abc..2916cb9274 100644 --- a/tests/topotests/ospf-topo1-vrf/r2/zebraroute.txt +++ b/tests/topotests/ospf-topo1-vrf/r2/zebraroute.txt @@ -1,10 +1,3 @@ -Codes: K - kernel route, C - connected, S - static, R - RIP, - O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, - T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, - F - PBR, - > - selected route, * - FIB route - - VRF r2-cust1: O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r2-eth1, XX:XX:XX O 10.0.2.0/24 [110/10] is directly connected, r2-eth0, XX:XX:XX diff --git a/tests/topotests/ospf-topo1-vrf/r2/zebraroutedown.txt b/tests/topotests/ospf-topo1-vrf/r2/zebraroutedown.txt index 7ad5f145e2..ccaf9abc31 100644 --- a/tests/topotests/ospf-topo1-vrf/r2/zebraroutedown.txt +++ b/tests/topotests/ospf-topo1-vrf/r2/zebraroutedown.txt @@ -1,10 +1,3 @@ -Codes: K - kernel route, C - connected, S - static, R - RIP, - O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, - T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, - F - PBR, - > - selected route, * - FIB route - - VRF r2-cust1: O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r2-eth1, XX:XX:XX O 10.0.2.0/24 [110/10] is directly connected, r2-eth0, XX:XX:XX diff --git a/tests/topotests/ospf-topo1-vrf/r3/zebraroute.txt b/tests/topotests/ospf-topo1-vrf/r3/zebraroute.txt index f6209421ab..70eae0a9fb 100644 --- a/tests/topotests/ospf-topo1-vrf/r3/zebraroute.txt +++ b/tests/topotests/ospf-topo1-vrf/r3/zebraroute.txt @@ -1,10 +1,3 @@ -Codes: K - kernel route, C - connected, S - static, R - RIP, - O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, - T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, - F - PBR, - > - selected route, * - FIB route - - VRF r3-cust1: O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r3-eth0, XX:XX:XX O>* 10.0.2.0/24 [110/20] via 10.0.3.3, r3-eth0, XX:XX:XX diff --git a/tests/topotests/ospf-topo1-vrf/r3/zebraroutedown.txt b/tests/topotests/ospf-topo1-vrf/r3/zebraroutedown.txt index 30b495d8a7..6d54782eff 100644 --- a/tests/topotests/ospf-topo1-vrf/r3/zebraroutedown.txt +++ b/tests/topotests/ospf-topo1-vrf/r3/zebraroutedown.txt @@ -1,10 +1,3 @@ -Codes: K - kernel route, C - connected, S - static, R - RIP, - O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, - T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, - F - PBR, - > - selected route, * - FIB route - - VRF r3-cust1: O 10.0.10.0/24 [110/10] is directly connected, r3-eth1, XX:XX:XX C>* 10.0.10.0/24 is directly connected, r3-eth1, XX:XX:XX