summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/topotests/lib/topotest.py10
-rw-r--r--tests/topotests/ospf-topo1-vrf/r1/zebraroute.txt7
-rw-r--r--tests/topotests/ospf-topo1-vrf/r1/zebraroutedown.txt7
-rw-r--r--tests/topotests/ospf-topo1-vrf/r2/zebraroute.txt7
-rw-r--r--tests/topotests/ospf-topo1-vrf/r2/zebraroutedown.txt7
-rw-r--r--tests/topotests/ospf-topo1-vrf/r3/zebraroute.txt7
-rw-r--r--tests/topotests/ospf-topo1-vrf/r3/zebraroutedown.txt7
7 files changed, 9 insertions, 43 deletions
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