]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/topotests/lib/topogen.py
tests: cleanup the config file specification and default code
[mirror_frr.git] / tests / topotests / lib / topogen.py
index 2d6138990ef87e3dcd37c58690d28a7ebdacd645..0e685a97b060af9087e388ee3b6c92e4dec18511 100644 (file)
@@ -798,23 +798,23 @@ class TopoRouter(TopoGear):
         Start the daemons in the list
         If daemons is None, try to infer daemons from the config file
         """
-        self.load_config(self.RD_FRR, source)
+        source_path = self.load_config(self.RD_FRR, source)
         if not daemons:
             # Always add zebra
-            self.load_config(self.RD_ZEBRA)
+            self.load_config(self.RD_ZEBRA, "")
             for daemon in self.RD:
                 # This will not work for all daemons
                 daemonstr = self.RD.get(daemon).rstrip("d")
                 if daemonstr == "pim":
-                    grep_cmd = "grep 'ip {}' {}".format(daemonstr, source)
+                    grep_cmd = "grep 'ip {}' {}".format(daemonstr, source_path)
                 else:
-                    grep_cmd = "grep 'router {}' {}".format(daemonstr, source)
+                    grep_cmd = "grep 'router {}' {}".format(daemonstr, source_path)
                 result = self.run(grep_cmd, warn=False).strip()
                 if result:
-                    self.load_config(daemon)
+                    self.load_config(daemon, "")
         else:
             for daemon in daemons:
-                self.load_config(daemon)
+                self.load_config(daemon, "")
 
     def load_config(self, daemon, source=None, param=None):
         """Loads daemon configuration from the specified source
@@ -833,7 +833,7 @@ class TopoRouter(TopoGear):
         """
         daemonstr = self.RD.get(daemon)
         self.logger.debug('loading "{}" configuration: {}'.format(daemonstr, source))
-        self.net.loadConf(daemonstr, source, param)
+        return self.net.loadConf(daemonstr, source, param)
 
     def check_router_running(self):
         """