From 4000805713a1f6305320b6711af3eeaf211110b0 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Tue, 27 Jul 2021 09:46:12 -0300 Subject: [PATCH] topotests: skip daemons without configuration Lets not start daemons without configurations. Signed-off-by: Rafael Zalamena --- tests/topotests/bfd_topo2/test_bfd_topo2.py | 33 +++++++++++---------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/tests/topotests/bfd_topo2/test_bfd_topo2.py b/tests/topotests/bfd_topo2/test_bfd_topo2.py index 6a19f70095..83326a9ed5 100644 --- a/tests/topotests/bfd_topo2/test_bfd_topo2.py +++ b/tests/topotests/bfd_topo2/test_bfd_topo2.py @@ -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()