]> git.puffer.fish Git - mirror/frr.git/commitdiff
ldp-topo1: Make the implicit label optional to pass old frr code as well
authorMartin Winter <mwinter@opensourcerouting.org>
Tue, 18 Jul 2017 04:14:28 +0000 (21:14 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:12 +0000 (20:22 -0500)
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
tests/topotests/ldp-topo1/r1/show_ipv4_route.ref
tests/topotests/ldp-topo1/r2/show_ipv4_route.ref
tests/topotests/ldp-topo1/r3/show_ipv4_route.ref
tests/topotests/ldp-topo1/r4/show_ipv4_route.ref
tests/topotests/ldp-topo1/test_ldp_topo1.py

index aadf03aa4930b8e998991c50fc79256ac41a962c..73c3fd9d209cfdeca462a90e2bd055801c99594c 100644 (file)
@@ -1,7 +1,7 @@
 O   1.1.1.1/32 [110/0] is directly connected, lo
-O>* 2.2.2.2/32 [110/10] via 10.0.1.2, r1-eth0, label xxx
+O>* 2.2.2.2/32 [110/10] via 10.0.1.2, r1-eth0, label y
 O>* 3.3.3.3/32 [110/20] via 10.0.1.2, r1-eth0, label xxx
 O>* 4.4.4.4/32 [110/20] via 10.0.1.2, r1-eth0, label xxx
 O   10.0.1.0/24 [110/10] is directly connected, r1-eth0
-O>* 10.0.2.0/24 [110/20] via 10.0.1.2, r1-eth0, label xxx
-O>* 10.0.3.0/24 [110/20] via 10.0.1.2, r1-eth0, label xxx
+O>* 10.0.2.0/24 [110/20] via 10.0.1.2, r1-eth0, label y
+O>* 10.0.3.0/24 [110/20] via 10.0.1.2, r1-eth0, label y
index db997018ea36a65aa7a337e49aebbec34ae429bb..9a624378265048f251212c10eeee95631c077a48 100644 (file)
@@ -1,7 +1,7 @@
-O>* 1.1.1.1/32 [110/10] via 10.0.1.1, r2-eth0, label xxx
+O>* 1.1.1.1/32 [110/10] via 10.0.1.1, r2-eth0, label y
 O   2.2.2.2/32 [110/0] is directly connected, lo
-O>* 3.3.3.3/32 [110/10] via 10.0.2.3, r2-eth1, label xxx
-O>* 4.4.4.4/32 [110/10] via 10.0.2.4, r2-eth1, label xxx
+O>* 3.3.3.3/32 [110/10] via 10.0.2.3, r2-eth1, label y
+O>* 4.4.4.4/32 [110/10] via 10.0.2.4, r2-eth1, label y
 O   10.0.1.0/24 [110/10] is directly connected, r2-eth0
 O   10.0.2.0/24 [110/10] is directly connected, r2-eth1
 O   10.0.3.0/24 [110/10] is directly connected, r2-eth2
index e5989a975fddb6240519018177c6f86d296bce53..41709e581525fb9c34f756e113cac27e20f8c2db 100644 (file)
@@ -1,7 +1,7 @@
 O>* 1.1.1.1/32 [110/20] via 10.0.2.2, r3-eth0, label xxx
-O>* 2.2.2.2/32 [110/10] via 10.0.2.2, r3-eth0, label xxx
+O>* 2.2.2.2/32 [110/10] via 10.0.2.2, r3-eth0, label y
 O   3.3.3.3/32 [110/0] is directly connected, lo
-O>* 4.4.4.4/32 [110/10] via 10.0.2.4, r3-eth0, label xxx
-O>* 10.0.1.0/24 [110/20] via 10.0.2.2, r3-eth0, label xxx
+O>* 4.4.4.4/32 [110/10] via 10.0.2.4, r3-eth0, label y
+O>* 10.0.1.0/24 [110/20] via 10.0.2.2, r3-eth0, label y
 O   10.0.2.0/24 [110/10] is directly connected, r3-eth0
 O   10.0.3.0/24 [110/10] is directly connected, r3-eth1
index 5ffaf78504e0f5ca0d8fdb993dbcaf4331b55f26..ab0db90a853bff219934b92f6732cd590d803db4 100644 (file)
@@ -1,7 +1,7 @@
 O>* 1.1.1.1/32 [110/20] via 10.0.2.2, r4-eth0, label xxx
-O>* 2.2.2.2/32 [110/10] via 10.0.2.2, r4-eth0, label xxx
-O>* 3.3.3.3/32 [110/10] via 10.0.2.3, r4-eth0, label xxx
+O>* 2.2.2.2/32 [110/10] via 10.0.2.2, r4-eth0, label y
+O>* 3.3.3.3/32 [110/10] via 10.0.2.3, r4-eth0, label y
 O   4.4.4.4/32 [110/0] is directly connected, lo
-O>* 10.0.1.0/24 [110/20] via 10.0.2.2, r4-eth0, label xxx
+O>* 10.0.1.0/24 [110/20] via 10.0.2.2, r4-eth0, label y
 O   10.0.2.0/24 [110/10] is directly connected, r4-eth0
-O>* 10.0.3.0/24 [110/20] via 10.0.2.2, r4-eth0, label xxx
+O>* 10.0.3.0/24 [110/20] via 10.0.2.2, r4-eth0, label y
index 82ee80fc24b6efed454b9c62b23563d9c4f9276a..187e6eb9f52ba7faeaf166865540d5c04ca9d92f 100755 (executable)
@@ -544,17 +544,26 @@ def test_zebra_ipv4_routingTable():
         if os.path.isfile(refTableFile):
             # Read expected result from file
             expected = open(refTableFile).read().rstrip()
-            # Fix newlines (make them all the same)
-            expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)
 
             # Actual output from router
             actual = net['r%s' % i].cmd('vtysh -c "show ip route" 2> /dev/null | grep "^O"').rstrip()
             # Drop timers on end of line (older Quagga Versions)
             actual = re.sub(r", [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", "", actual)
-            # Mask out label
-            actual = re.sub(r" label [0-9]+", " label xxx", actual)
+
+            # Mask out label - all LDP labels should be >= 10 (2-digit)
+            #   leaving the implicit labels unmasked
+            actual = re.sub(r" label [0-9][0-9]+", " label xxx", actual)
+            #   and translating remaining implicit (single-digit) labels to label y
+            actual = re.sub(r" label [0-9]+", " label y", actual)
+            # Check if we have implicit labels - if not, then remove them from reference
+            if (not re.search(r" label y", actual)):
+               expected = re.sub(r", label y", "", expected)
+
+            # now fix newlines of expected (make them all the same)
+            expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)
+
             # Add missing comma before label (for old version)
-            actual = re.sub(r"([0-9]) label xxx", r"\1, label xxx", actual)
+            actual = re.sub(r"([0-9]) label ", r"\1, label ", actual)
 
             # Fix newlines (make them all the same)
             actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1)