From: Martin Winter Date: Thu, 18 Jan 2018 03:49:02 +0000 (-0800) Subject: ospf-topo1: Allow IPv6 ECMP version to pass X-Git-Tag: frr-7.1-dev~151^2~180 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d75f5f94cd756b2aec6d4760a380185fcd6d6c33;p=matthieu%2Ffrr.git ospf-topo1: Allow IPv6 ECMP version to pass Check ospf IPv6 routes for ECMP version first and fallback to previous version if needed. Signed-off-by: Martin Winter --- diff --git a/tests/topotests/ospf-topo1/r1/ospf6route_ecmp.txt b/tests/topotests/ospf-topo1/r1/ospf6route_ecmp.txt new file mode 100644 index 0000000000..4df6e5ec00 --- /dev/null +++ b/tests/topotests/ospf-topo1/r1/ospf6route_ecmp.txt @@ -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 index 0000000000..f58b501e31 --- /dev/null +++ b/tests/topotests/ospf-topo1/r2/ospf6route_ecmp.txt @@ -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 index 0000000000..54e575adcb --- /dev/null +++ b/tests/topotests/ospf-topo1/r3/ospf6route_ecmp.txt @@ -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 index 0000000000..b5cb10b72b --- /dev/null +++ b/tests/topotests/ospf-topo1/r4/ospf6route_ecmp.txt @@ -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 diff --git a/tests/topotests/ospf-topo1/test_ospf_topo1.py b/tests/topotests/ospf-topo1/test_ospf_topo1.py index 586b6462b1..147a32a5d6 100755 --- a/tests/topotests/ospf-topo1/test_ospf_topo1.py +++ b/tests/topotests/ospf-topo1/test_ospf_topo1.py @@ -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():