]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: fix implicit config file and recently added logic error
authorChristian Hopps <chopps@labn.net>
Wed, 17 May 2023 11:10:13 +0000 (07:10 -0400)
committerChristian Hopps <chopps@labn.net>
Wed, 17 May 2023 20:05:53 +0000 (16:05 -0400)
- Restore default of looking for a daemon config underneath the router directory
if no config file was specified.
- Recent change for adding unified config support had a logic bug, fix
- Update the one test that conflicted with this default
- comment out asyncio option causing warnings if asyncio wasn't installed.

Signed-off-by: Christian Hopps <chopps@labn.net>
tests/topotests/bgp_auth/test_bgp_auth1.py
tests/topotests/bgp_auth/test_bgp_auth2.py
tests/topotests/bgp_auth/test_bgp_auth3.py
tests/topotests/bgp_auth/test_bgp_auth4.py
tests/topotests/lib/topotest.py
tests/topotests/pytest.ini

index 566d391f7ab0ec7234db8489f5cbdf9c08ba10b2..9d47106c072fe1a68a2576caa80ec13c5d9c9982 100644 (file)
@@ -158,8 +158,8 @@ def setup_module(mod):
     # For all registered routers, load the zebra configuration file
     for rname, router in router_list.items():
         router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
-        router.load_config(TopoRouter.RD_OSPF)
-        router.load_config(TopoRouter.RD_BGP)
+        router.load_config(TopoRouter.RD_OSPF, "")
+        router.load_config(TopoRouter.RD_BGP, "")
 
     # After copying the configurations, this function loads configured daemons.
     tgen.start_router()
index 0e9942a22725ea98a17fcb09b4dacd3768f6bf36..6b920367270f4a45d10a47e7902cbca58a3f899e 100644 (file)
@@ -158,8 +158,8 @@ def setup_module(mod):
     # For all registered routers, load the zebra configuration file
     for rname, router in router_list.items():
         router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
-        router.load_config(TopoRouter.RD_OSPF)
-        router.load_config(TopoRouter.RD_BGP)
+        router.load_config(TopoRouter.RD_OSPF, "")
+        router.load_config(TopoRouter.RD_BGP, "")
 
     # After copying the configurations, this function loads configured daemons.
     tgen.start_router()
index 99a8953b3fc316b6701d5a6a8f9e661feece1449..2237c6b1b6dc65614c0f4fd880fa8da136fd11d0 100644 (file)
@@ -157,8 +157,8 @@ def setup_module(mod):
     # For all registered routers, load the zebra configuration file
     for rname, router in router_list.items():
         router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
-        router.load_config(TopoRouter.RD_OSPF)
-        router.load_config(TopoRouter.RD_BGP)
+        router.load_config(TopoRouter.RD_OSPF, "")
+        router.load_config(TopoRouter.RD_BGP, "")
 
     # After copying the configurations, this function loads configured daemons.
     tgen.start_router()
index dffef0eef70079c62d7c23596c3abdee74d211ad..d6fe42504bc28dc40d0de4df81bd7cfc842f32fb 100644 (file)
@@ -157,8 +157,8 @@ def setup_module(mod):
     # For all registered routers, load the zebra configuration file
     for rname, router in router_list.items():
         router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
-        router.load_config(TopoRouter.RD_OSPF)
-        router.load_config(TopoRouter.RD_BGP)
+        router.load_config(TopoRouter.RD_OSPF, "")
+        router.load_config(TopoRouter.RD_BGP, "")
 
     # After copying the configurations, this function loads configured daemons.
     tgen.start_router()
index 9c594d3c8efdd0913a2079ed49b9b9dc33a9cc78..aeb83d42904547e999318e3c5c1f5c1153745e03 100644 (file)
@@ -1527,6 +1527,9 @@ class Router(Node):
         """
 
         # Unfortunately this API allowsfor source to not exist for any and all routers.
+        if source is None:
+            source = f"{daemon}.conf"
+
         if source:
             head, tail = os.path.split(source)
             if not head and not self.path_exists(tail):
@@ -1558,7 +1561,7 @@ class Router(Node):
                     self.cmd_raises("cp {} {}".format(source, conf_file_mgmt))
                 self.cmd_raises("cp {} {}".format(source, conf_file))
 
-            if not self.unified_config or daemon == "frr":
+            if not (self.unified_config or daemon == "frr"):
                 self.cmd_raises("chown {0}:{0} {1}".format(self.routertype, conf_file))
                 self.cmd_raises("chmod 664 {}".format(conf_file))
 
@@ -1952,7 +1955,7 @@ class Router(Node):
                 tail_log_files.append("{}/{}/frr.log".format(self.logdir, self.name))
 
         for tailf in tail_log_files:
-            self.run_in_window("tail -f " + tailf, title=tailf, background=True)
+            self.run_in_window("tail -n10000 -F " + tailf, title=tailf, background=True)
 
         return ""
 
index f779bf0a74f74dab434393c6c648e285c4e4aed2..0062cf3de29704d5654a5bd70dee171d0a787dc1 100644 (file)
@@ -1,7 +1,7 @@
 # Skip pytests example directory
 [pytest]
 
-asyncio_mode = auto
+asyncio_mode = auto
 
 # We always turn this on inside conftest.py, default shown
 # addopts = --junitxml=<rundir>/topotests.xml