From: Donatas Abraitis Date: Thu, 31 Oct 2024 08:43:28 +0000 (+0200) Subject: tests: Add an ability to specify daemon params with unified config X-Git-Tag: docker/10.2.0~10^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F17325%2Fhead;p=mirror%2Ffrr.git tests: Add an ability to specify daemon params with unified config Signed-off-by: Donatas Abraitis (cherry picked from commit 879466731bf36eaf696a29c8d96914443660dd74) --- diff --git a/doc/developer/topotests.rst b/doc/developer/topotests.rst index 6209749636..d2308bea94 100644 --- a/doc/developer/topotests.rst +++ b/doc/developer/topotests.rst @@ -1347,9 +1347,9 @@ or using unified config (specifying which daemons to run is optional): for _, (rname, router) in enumerate(router_list.items(), 1): router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)), [ - TopoRouter.RD_ZEBRA - TopoRouter.RD_MGMTD, - TopoRouter.RD_BGP]) + (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 14dd61b077..b1da296365 100644 --- a/tests/topotests/lib/topogen.py +++ b/tests/topotests/lib/topogen.py @@ -833,6 +833,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: @@ -849,8 +851,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