summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-10-31 10:43:28 +0200
committerDonald Sharp <donaldsharp72@gmail.com>2025-03-12 13:05:25 -0400
commitd64f15289ba208bd1417acc878ce8356b196d1c7 (patch)
treeb21321f4b1fad014689c42fdb7519cb1f8cbb500
parent99a3acaf879027f3d7a2c6b22b758ffedca9342d (diff)
tests: Add an ability to specify daemon params with unified config
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
-rw-r--r--doc/developer/topotests.rst9
-rw-r--r--tests/topotests/lib/topogen.py7
2 files changed, 14 insertions, 2 deletions
diff --git a/doc/developer/topotests.rst b/doc/developer/topotests.rst
index e1702c47c7..1089287bc2 100644
--- a/doc/developer/topotests.rst
+++ b/doc/developer/topotests.rst
@@ -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
diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py
index 7941e5c1d2..8b01b9b317 100644
--- a/tests/topotests/lib/topogen.py
+++ b/tests/topotests/lib/topogen.py
@@ -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