]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/topotests/ospf_topo1/test_ospf_topo1.py
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / tests / topotests / ospf_topo1 / test_ospf_topo1.py
index e2a6ff64a48553bb7dedea9892c859d7ddd34832..a079f5698ff1113d1e942d522c758831cb73309c 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_ospf_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2017 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 """
 test_ospf_topo1.py: Test the FRR OSPF routing daemon.
@@ -316,17 +303,26 @@ def test_ospf6_kernel_route():
     for router in rlist:
         logger.info('Checking OSPF IPv6 kernel routes in "%s"', router.name)
 
-        routes = topotest.ip6_route(router)
-        expected = {
-            "2001:db8:1::/64": {},
-            "2001:db8:2::/64": {},
-            "2001:db8:3::/64": {},
-            "2001:db8:100::/64": {},
-            "2001:db8:200::/64": {},
-            "2001:db8:300::/64": {},
-        }
+        def _routes_in_fib6():
+            routes = topotest.ip6_route(router)
+            expected = {
+                "2001:db8:1::/64": {},
+                "2001:db8:2::/64": {},
+                "2001:db8:3::/64": {},
+                "2001:db8:100::/64": {},
+                "2001:db8:200::/64": {},
+                "2001:db8:300::/64": {},
+            }
+            logger.info("Routes:")
+            logger.info(routes)
+            logger.info(topotest.json_cmp(routes, expected))
+            logger.info("ENd:")
+            return topotest.json_cmp(routes, expected)
+
+        _, result = topotest.run_and_expect(_routes_in_fib6, None, count=20, wait=1)
+
         assertmsg = 'OSPF IPv6 route mismatch in router "{}"'.format(router.name)
-        assert topotest.json_cmp(routes, expected) is None, assertmsg
+        assert result is None, assertmsg
 
 
 def test_ospf_json():
@@ -337,6 +333,7 @@ def test_ospf_json():
 
     for rnum in range(1, 5):
         router = tgen.gears["r{}".format(rnum)]
+        logger.info(router.vtysh_cmd("show ip ospf database"))
         logger.info('Comparing router "%s" "show ip ospf json" output', router.name)
         expected = {
             "routerId": "10.0.255.{}".format(rnum),