]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib/ospf-topo1-vrf: don't compare headers of show ip route
authorChristian Franke <nobody@nowhere.ws>
Sat, 25 Aug 2018 16:46:46 +0000 (18:46 +0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:14 +0000 (20:22 -0500)
Signed-off-by: Christian Franke <nobody@nowhere.ws>
tests/topotests/lib/topotest.py
tests/topotests/ospf-topo1-vrf/r1/zebraroute.txt
tests/topotests/ospf-topo1-vrf/r1/zebraroutedown.txt
tests/topotests/ospf-topo1-vrf/r2/zebraroute.txt
tests/topotests/ospf-topo1-vrf/r2/zebraroutedown.txt
tests/topotests/ospf-topo1-vrf/r3/zebraroute.txt
tests/topotests/ospf-topo1-vrf/r3/zebraroutedown.txt

index 5cc222e1490cba1d185801c1c326e8bab1d5f4a2..d1985b008e047395c944ed62c41fb60cb2422f52 100644 (file)
@@ -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):
     """
index a5e957327ec3705741ac785faec07f5a08d85c8a..973db543fa9676fb1b757355781884f873cfdaa7 100644 (file)
@@ -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
index b6ef09988a63092e2c18ce0a238b07ce0803e2d5..7bdccd0909f2b02c4c29e33651920a2f2635aacf 100644 (file)
@@ -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
index d079c62abc10b14c065430e624d17f2ba80f5604..2916cb9274eca160f27bebc8615cf83fdbd01cfb 100644 (file)
@@ -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
index 7ad5f145e27ce709e92d77970e786593b40661e6..ccaf9abc3109a6a037266f002b1f5e191ae59c13 100644 (file)
@@ -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
index f6209421abaf1161c67468c0fed312c5b750e3a8..70eae0a9fb4e49366ba0bedb5a4421d3ef4cb221 100644 (file)
@@ -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
index 30b495d8a7d1b9908782cfed9a1295d2b841d134..6d54782eff3374449c05af989ee94e522df29636 100644 (file)
@@ -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