summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2021-07-27 09:46:12 -0300
committerRafael Zalamena <rzalamena@opensourcerouting.org>2021-08-06 10:38:36 -0300
commit4000805713a1f6305320b6711af3eeaf211110b0 (patch)
tree9cbc9c90ba92d83aeb107f876c45ca95ff483dce
parent20ec1f7038508f9e39a9f25fdbd1ca30cff310a5 (diff)
topotests: skip daemons without configuration
Lets not start daemons without configurations. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
-rw-r--r--tests/topotests/bfd_topo2/test_bfd_topo2.py33
1 files 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()