summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-01-10 14:57:18 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-01-10 14:57:18 +0100
commitabb5d7a9331626dd6d3bcd0241fcc24799e88ad7 (patch)
tree3e329527d0c4b94f8dddb325a42fd376572510a5
parentMerge pull request #5410 from ton31337/feature/bgp_default-route_with_route-m... (diff)
downloadfrr-abb5d7a9331626dd6d3bcd0241fcc24799e88ad7.tar.xz
frr-abb5d7a9331626dd6d3bcd0241fcc24799e88ad7.zip
tests: ospf6-topo1 did not work properly with nhg's and 5.3 kernels
Fix the ospf6-topo1 test to understand nhg's and what happens when they are installed into a kernel that can support them. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--tests/topotests/ospf6-topo1/r1/ip_6_address.nhg.ref10
-rwxr-xr-xtests/topotests/ospf6-topo1/test_ospf6_topo1.py8
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/topotests/ospf6-topo1/r1/ip_6_address.nhg.ref b/tests/topotests/ospf6-topo1/r1/ip_6_address.nhg.ref
new file mode 100644
index 000000000..11fd9fe3c
--- /dev/null
+++ b/tests/topotests/ospf6-topo1/r1/ip_6_address.nhg.ref
@@ -0,0 +1,10 @@
+fc00:1111:1111:1111::/64 nhid XXXX via fc00:1:1:1::1234 dev r1-stubnet proto XXXX metric 20 pref medium
+fc00:1:1:1::/64 dev r1-stubnet proto XXXX metric 256 pref medium
+fc00:2222:2222:2222::/64 nhid XXXX via fe80::__(r2-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
+fc00:2:2:2::/64 nhid XXXX via fe80::__(r2-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
+fc00:3333:3333:3333::/64 nhid XXXX via fe80::__(r3-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
+fc00:3:3:3::/64 nhid XXXX via fe80::__(r3-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
+fc00:4444:4444:4444::/64 nhid XXXX via fe80::__(r3-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
+fc00:4:4:4::/64 nhid XXXX via fe80::__(r3-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
+fc00:a:a:a::/64 dev r1-sw5 proto XXXX metric 256 pref medium
+fc00:b:b:b::/64 nhid XXXX via fe80::__(r3-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
diff --git a/tests/topotests/ospf6-topo1/test_ospf6_topo1.py b/tests/topotests/ospf6-topo1/test_ospf6_topo1.py
index b70ae0226..cb0c4af22 100755
--- a/tests/topotests/ospf6-topo1/test_ospf6_topo1.py
+++ b/tests/topotests/ospf6-topo1/test_ospf6_topo1.py
@@ -89,7 +89,7 @@ sys.path.append(os.path.join(CWD, '../'))
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
-
+import platform
#####################################################
##
@@ -319,7 +319,10 @@ def test_linux_ipv6_kernel_routingTable():
# Now compare the routing tables (after substituting link-local addresses)
for i in range(1, 5):
- refTableFile = os.path.join(CWD, 'r{}/ip_6_address.ref'.format(i))
+ if topotest.version_cmp(platform.release(), '5.3') < 0:
+ refTableFile = os.path.join(CWD, 'r{}/ip_6_address.ref'.format(i))
+ else:
+ refTableFile = os.path.join(CWD, 'r{}/ip_6_address.nhg.ref'.format(i))
if os.path.isfile(refTableFile):
expected = open(refTableFile).read().rstrip()
@@ -333,6 +336,7 @@ def test_linux_ipv6_kernel_routingTable():
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"[ ]+nhid [0-9]+ +", " nhid XXXX ", actual)
# Remove ff00::/8 routes (seen on some kernels - not from FRR)
actual = re.sub(r'ff00::/8.*', '', actual)