Merge pull request #17317 from opensourcerouting/feature/allow_setting_custom_params_for_daemons_unified_config

tests: Add an ability to specify daemon params with unified config
This commit is contained in:
Jafar Al-Gharaibeh 2024-10-31 08:55:23 -05:00 committed by GitHub
commit 35dbbacc3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -1349,9 +1349,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

View File

@ -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