From dd3ddc066353c614f43cb91f08a9fa473fa538c6 Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Wed, 25 Oct 2017 17:56:33 -0700 Subject: [PATCH] Fix output to allow it on generic Debian MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Generic Debian only has a single space in front of “proto” in the linux shell routing outptu Signed-off-by: Martin Winter --- tests/topotests/ldp-topo1/test_ldp_topo1.py | 2 +- tests/topotests/ospf6-topo1/test_ospf6_topo1.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/topotests/ldp-topo1/test_ldp_topo1.py b/tests/topotests/ldp-topo1/test_ldp_topo1.py index 818e64723e..c8ea438cce 100755 --- a/tests/topotests/ldp-topo1/test_ldp_topo1.py +++ b/tests/topotests/ldp-topo1/test_ldp_topo1.py @@ -690,7 +690,7 @@ def test_linux_mpls_routes(): actual = re.sub(r"[0-9][0-9] via inet ", "xx via inet ", actual) actual = re.sub(r"[0-9][0-9] proto", "xx proto", actual) actual = re.sub(r"[0-9][0-9] as to ", "xx as to ", actual) - actual = re.sub(r"proto \w+", "proto xx", actual) + actual = re.sub(r"[ ]+proto \w+", " proto xx", actual) # Fix newlines (make them all the same) actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1) diff --git a/tests/topotests/ospf6-topo1/test_ospf6_topo1.py b/tests/topotests/ospf6-topo1/test_ospf6_topo1.py index 2c49dff23b..fd65699e7f 100755 --- a/tests/topotests/ospf6-topo1/test_ospf6_topo1.py +++ b/tests/topotests/ospf6-topo1/test_ospf6_topo1.py @@ -332,7 +332,7 @@ def test_linux_ipv6_kernel_routingTable(): for ll in linklocals: actual = actual.replace(ll[1], "fe80::__(%s)__" % ll[0]) # Mask out protocol name or number - actual = re.sub(r" proto [0-9a-z]+ ", " proto XXXX ", actual) + actual = re.sub(r"[ ]+proto [0-9a-z]+ ", " proto XXXX ", actual) # Remove ff00::/8 routes (seen on some kernels - not from FRR) actual = re.sub(r'ff00::/8.*', '', actual) -- 2.39.5