]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf-topo1: Allow IPv6 ECMP version to pass
authorMartin Winter <mwinter@opensourcerouting.org>
Thu, 18 Jan 2018 03:49:02 +0000 (19:49 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:12 +0000 (20:22 -0500)
Check ospf IPv6 routes for ECMP version first and fallback
to previous version if needed.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
tests/topotests/ospf-topo1/r1/ospf6route_ecmp.txt [new file with mode: 0644]
tests/topotests/ospf-topo1/r2/ospf6route_ecmp.txt [new file with mode: 0644]
tests/topotests/ospf-topo1/r3/ospf6route_ecmp.txt [new file with mode: 0644]
tests/topotests/ospf-topo1/r4/ospf6route_ecmp.txt [new file with mode: 0644]
tests/topotests/ospf-topo1/test_ospf_topo1.py

diff --git a/tests/topotests/ospf-topo1/r1/ospf6route_ecmp.txt b/tests/topotests/ospf-topo1/r1/ospf6route_ecmp.txt
new file mode 100644 (file)
index 0000000..4df6e5e
--- /dev/null
@@ -0,0 +1,13 @@
+*N IA 2001:db8:1::/64                ::                        r1-eth0 00:06:13
+*N IA 2001:db8:2::/64                fe80::e8bb:62ff:fee8:7022 r1-eth1 00:06:08
+ N E1 2001:db8:2::/64                fe80::e8bb:62ff:fee8:7022 r1-eth1 00:06:08
+*N IA 2001:db8:3::/64                ::                        r1-eth1 00:06:13
+ N E1 2001:db8:3::/64                fe80::400f:dff:fe35:a1e7  r1-eth1 00:06:08
+                                     fe80::e8bb:62ff:fee8:7022 r1-eth1 
+*N IA 2001:db8:100::/64              fe80::400f:dff:fe35:a1e7  r1-eth1 00:06:08
+ N E1 2001:db8:100::/64              fe80::400f:dff:fe35:a1e7  r1-eth1 00:06:08
+*N IE 2001:db8:200::/64              fe80::400f:dff:fe35:a1e7  r1-eth1 00:06:08
+ N E1 2001:db8:200::/64              fe80::400f:dff:fe35:a1e7  r1-eth1 00:06:08
+ N E1 2001:db8:200::/64              fe80::400f:dff:fe35:a1e7  r1-eth1 00:06:07
+*N IE 2001:db8:300::/64              fe80::400f:dff:fe35:a1e7  r1-eth1 00:06:07
+ N E1 2001:db8:300::/64              fe80::400f:dff:fe35:a1e7  r1-eth1 00:06:07
diff --git a/tests/topotests/ospf-topo1/r2/ospf6route_ecmp.txt b/tests/topotests/ospf-topo1/r2/ospf6route_ecmp.txt
new file mode 100644 (file)
index 0000000..f58b501
--- /dev/null
@@ -0,0 +1,13 @@
+*N IA 2001:db8:1::/64                fe80::98cd:28ff:fe5e:3d93 r2-eth1 00:07:04
+ N E1 2001:db8:1::/64                fe80::98cd:28ff:fe5e:3d93 r2-eth1 00:07:04
+*N IA 2001:db8:2::/64                ::                        r2-eth0 00:07:09
+*N IA 2001:db8:3::/64                ::                        r2-eth1 00:07:04
+ N E1 2001:db8:3::/64                fe80::400f:dff:fe35:a1e7  r2-eth1 00:07:04
+                                     fe80::98cd:28ff:fe5e:3d93 r2-eth1 
+*N IA 2001:db8:100::/64              fe80::400f:dff:fe35:a1e7  r2-eth1 00:07:04
+ N E1 2001:db8:100::/64              fe80::400f:dff:fe35:a1e7  r2-eth1 00:07:04
+*N IE 2001:db8:200::/64              fe80::400f:dff:fe35:a1e7  r2-eth1 00:07:04
+ N E1 2001:db8:200::/64              fe80::400f:dff:fe35:a1e7  r2-eth1 00:07:04
+ N E1 2001:db8:200::/64              fe80::400f:dff:fe35:a1e7  r2-eth1 00:07:03
+*N IE 2001:db8:300::/64              fe80::400f:dff:fe35:a1e7  r2-eth1 00:07:03
+ N E1 2001:db8:300::/64              fe80::400f:dff:fe35:a1e7  r2-eth1 00:07:03
diff --git a/tests/topotests/ospf-topo1/r3/ospf6route_ecmp.txt b/tests/topotests/ospf-topo1/r3/ospf6route_ecmp.txt
new file mode 100644 (file)
index 0000000..54e575a
--- /dev/null
@@ -0,0 +1,12 @@
+*N IA 2001:db8:1::/64                fe80::98cd:28ff:fe5e:3d93 r3-eth0 00:08:58
+ N E1 2001:db8:1::/64                fe80::98cd:28ff:fe5e:3d93 r3-eth0 00:08:58
+*N IA 2001:db8:2::/64                fe80::e8bb:62ff:fee8:7022 r3-eth0 00:08:58
+ N E1 2001:db8:2::/64                fe80::e8bb:62ff:fee8:7022 r3-eth0 00:08:58
+*N IA 2001:db8:3::/64                ::                        r3-eth0 00:09:03
+ N E1 2001:db8:3::/64                fe80::98cd:28ff:fe5e:3d93 r3-eth0 00:08:58
+                                     fe80::e8bb:62ff:fee8:7022 r3-eth0 
+*N IA 2001:db8:100::/64              ::                        r3-eth1 00:09:03
+*N IA 2001:db8:200::/64              ::                        r3-eth2 00:09:02
+ N E1 2001:db8:200::/64              fe80::d0dc:aff:fec5:5973  r3-eth2 00:08:57
+*N IA 2001:db8:300::/64              fe80::d0dc:aff:fec5:5973  r3-eth2 00:08:57
+ N E1 2001:db8:300::/64              fe80::d0dc:aff:fec5:5973  r3-eth2 00:08:57
diff --git a/tests/topotests/ospf-topo1/r4/ospf6route_ecmp.txt b/tests/topotests/ospf-topo1/r4/ospf6route_ecmp.txt
new file mode 100644 (file)
index 0000000..b5cb10b
--- /dev/null
@@ -0,0 +1,12 @@
+*N IE 2001:db8:1::/64                fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+ N E1 2001:db8:1::/64                fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+*N IE 2001:db8:2::/64                fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+ N E1 2001:db8:2::/64                fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+*N IE 2001:db8:3::/64                fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+ N E1 2001:db8:3::/64                fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+ N E1 2001:db8:3::/64                fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+*N IE 2001:db8:100::/64              fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+ N E1 2001:db8:100::/64              fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+*N IA 2001:db8:200::/64              ::                        r4-eth0 00:09:17
+ N E1 2001:db8:200::/64              fe80::78fe:fcff:fe51:9afc r4-eth0 00:09:13
+*N IA 2001:db8:300::/64              ::                        r4-eth1 00:09:18
index 586b6462b1528f4a77acce99d0a44bb17825d31c..147a32a5d63e7f3b6a86bf41b964eea786093342 100755 (executable)
@@ -196,19 +196,44 @@ def test_ospf6_convergence():
     if tgen.routers_have_failure():
         pytest.skip('skipped because of router(s) failure')
 
+    ospf6route_file = '{}/ospf6route_ecmp.txt'
     for rnum in range(1, 5):
         router = 'r{}'.format(rnum)
 
         logger.info('Waiting for router "%s" IPv6 OSPF convergence', router)
 
         # Load expected results from the command
-        reffile = os.path.join(CWD, '{}/ospf6route.txt'.format(router))
+        reffile = os.path.join(CWD, ospf6route_file.format(router))
         expected = open(reffile).read()
 
         # Run test function until we get an result. Wait at most 60 seconds.
         test_func = partial(compare_show_ipv6_ospf6, router, expected)
         result, diff = topotest.run_and_expect(test_func, '',
                                                count=25, wait=3)
+        if (not result) and (rnum == 1):
+            # Didn't match the new ECMP version - try the old pre-ECMP format
+            ospf6route_file = '{}/ospf6route.txt'
+
+            # Load expected results from the command
+            reffile = os.path.join(CWD, ospf6route_file.format(router))
+            expected = open(reffile).read()
+
+            test_func = partial(compare_show_ipv6_ospf6, router, expected)
+            result, diff = topotest.run_and_expect(test_func, '',
+                                               count=1, wait=3)
+            if not result:
+                # Didn't match the old version - switch back to new ECMP version
+                # and fail
+                ospf6route_file = '{}/ospf6route_ecmp.txt'
+
+                # Load expected results from the command
+                reffile = os.path.join(CWD, ospf6route_file.format(router))
+                expected = open(reffile).read()
+
+                test_func = partial(compare_show_ipv6_ospf6, router, expected)
+                result, diff = topotest.run_and_expect(test_func, '',
+                                               count=1, wait=3)
+
         assert result, 'OSPF6 did not converge on {}:\n{}'.format(router, diff)
 
 def test_ospf6_kernel_route():