From 07c209b49312a23ec74eb74cf47390236878e43d Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Tue, 10 Sep 2024 16:25:23 +0200 Subject: [PATCH] topotests: load configuration from vtysh 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 --- tests/topotests/lib/topogen.py | 4 ++++ tests/topotests/lib/topotest.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py index 7941e5c1d233..76d86bbcca11 100644 --- a/tests/topotests/lib/topogen.py +++ b/tests/topotests/lib/topogen.py @@ -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): diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 5a8c2e5964a6..0603f917db0f 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -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'", @@ -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,