]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: skip daemons without configuration
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 27 Jul 2021 12:46:12 +0000 (09:46 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 6 Aug 2021 13:38:36 +0000 (10:38 -0300)
Lets not start daemons without configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/bfd_topo2/test_bfd_topo2.py

index 6a19f70095fcb485f09921602bb86157076d41c4..83326a9ed59170ee6e0c575485c601af9cb298fb 100644 (file)
@@ -80,21 +80,24 @@ def setup_module(mod):
 
     router_list = tgen.routers()
     for rname, router in router_list.items():
-        router.load_config(
-            TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
-        )
-        router.load_config(
-            TopoRouter.RD_BFD, os.path.join(CWD, "{}/bfdd.conf".format(rname))
-        )
-        router.load_config(
-            TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
-        )
-        router.load_config(
-            TopoRouter.RD_OSPF, os.path.join(CWD, "{}/ospfd.conf".format(rname))
-        )
-        router.load_config(
-            TopoRouter.RD_OSPF6, os.path.join(CWD, "{}/ospf6d.conf".format(rname))
-        )
+        daemon_file = "{}/{}/zebra.conf".format(CWD, rname)
+        router.load_config(TopoRouter.RD_ZEBRA, daemon_file)
+
+        daemon_file = "{}/{}/bfdd.conf".format(CWD, rname)
+        if os.path.isfile(daemon_file):
+            router.load_config(TopoRouter.RD_BFD, daemon_file)
+
+        daemon_file = "{}/{}/bgpd.conf".format(CWD, rname)
+        if os.path.isfile(daemon_file):
+            router.load_config(TopoRouter.RD_BGP, daemon_file)
+
+        daemon_file = "{}/{}/ospfd.conf".format(CWD, rname)
+        if os.path.isfile(daemon_file):
+            router.load_config(TopoRouter.RD_OSPF, daemon_file)
+
+        daemon_file = "{}/{}/ospf6d.conf".format(CWD, rname)
+        if os.path.isfile(daemon_file):
+            router.load_config(TopoRouter.RD_OSPF6, daemon_file)
 
     # Initialize all routers.
     tgen.start_router()