]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Add an ability to specify daemon params with unified config 18373/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 31 Oct 2024 08:43:28 +0000 (10:43 +0200)
committerDonald Sharp <donaldsharp72@gmail.com>
Wed, 12 Mar 2025 17:05:25 +0000 (13:05 -0400)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
doc/developer/topotests.rst
tests/topotests/lib/topogen.py

index e1702c47c78169a2087b84138faa4e64ced37520..1089287bc2c6f453dd6232a4bcaee1a2a0d6f01d 100644 (file)
@@ -1292,6 +1292,15 @@ Example:
            router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
            router.load_config(TopoRouter.RD_OSPF)
 
+or using unified config (specifying which daemons to run is optional):
+
+.. code:: py
+
+      for _, (rname, router) in enumerate(router_list.items(), 1):
+         router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)), [
+            (TopoRouter.RD_ZEBRA, "-s 90000000"),
+            (TopoRouter.RD_MGMTD, None),
+            (TopoRouter.RD_BGP, None)]
 
 - The topology definition or build function
 
index 7941e5c1d23337258aa7a475dab2cdc105db9f35..8b01b9b317bac93833c8c594d9f9f7b3111026f2 100644 (file)
@@ -824,6 +824,8 @@ class TopoRouter(TopoGear):
         Loads the unified configuration file source
         Start the daemons in the list
         If daemons is None, try to infer daemons from the config file
+        `daemons` is a tuple (daemon, param) of daemons to start, e.g.:
+        (TopoRouter.RD_ZEBRA, "-s 90000000").
         """
         source_path = self.load_config(self.RD_FRR, source)
         if not daemons:
@@ -840,8 +842,9 @@ class TopoRouter(TopoGear):
                 if result:
                     self.load_config(daemon, "")
         else:
-            for daemon in daemons:
-                self.load_config(daemon, "")
+            for item in daemons:
+                daemon, param = item
+                self.load_config(daemon, "", param)
 
     def load_config(self, daemon, source=None, param=None):
         """Loads daemon configuration from the specified source