Skip to content

Commit

Permalink
topotests: load configuration from vtysh
Browse files Browse the repository at this point in the history
Dirty fix to check that is possible to load configuration from vtysh
at startup.

It tests that northbound configuration can be committed together.

Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Sep 10, 2024
1 parent 3c173df commit 07c209b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/topotests/lib/topogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,10 @@ def start(self):
nrouter, "net.mpls.conf.{}.input".format(interface), 1
)

# self.cmd("cat /etc/frr/*.confall | vtysh -f /dev/stdin")
self.cmd("cat /etc/frr/*.confall | sed 1iXFRR_start_configuration | sed 1iconfigure\ t\ file-lock | sed '$aXFRR_end_configuration' | vtysh")
self.cmd("for file in $(ls /etc/frr/*.confall); do mv $file ${file%.confall}.conf; done")

return result

def stop(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/lib/topotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@ def loadConf(self, daemon, source=None, param=None):
self.daemons[daemon] = 1
if param is not None:
self.daemons_options[daemon] = param
conf_file = "/etc/{}/{}.conf".format(self.routertype, daemon)
conf_file = "/etc/{}/{}.confall".format(self.routertype, daemon)
if source and not os.path.exists(source):
logger.warning(
"missing config '%s' for '%s' creating empty file '%s'",
Expand All @@ -1676,7 +1676,7 @@ def loadConf(self, daemon, source=None, param=None):
elif source:
# copy zebra.conf to mgmtd folder, which can be used during startup
if daemon == "zebra" and not self.unified_config:
conf_file_mgmt = "/etc/{}/{}.conf".format(self.routertype, "mgmtd")
conf_file_mgmt = "/etc/{}/{}.confall".format(self.routertype, "mgmtd")
logger.debug(
"copying '%s' as '%s' on '%s'",
source,
Expand Down

0 comments on commit 07c209b

Please sign in to comment.