summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/common_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/lib/common_config.py')
-rw-r--r--tests/topotests/lib/common_config.py68
1 files changed, 50 insertions, 18 deletions
diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py
index 737226c7fe..676a5704e5 100644
--- a/tests/topotests/lib/common_config.py
+++ b/tests/topotests/lib/common_config.py
@@ -961,7 +961,7 @@ def generate_support_bundle():
return True
-def start_topology(tgen, daemon=None):
+def start_topology(tgen):
"""
Starting topology, create tmp files which are loaded to routers
to start daemons and then start routers
@@ -1009,38 +1009,70 @@ def start_topology(tgen, daemon=None):
except IOError as err:
logger.error("I/O error({0}): {1}".format(err.errno, err.strerror))
- # Loading empty zebra.conf file to router, to start the zebra daemon
+ topo = tgen.json_topo
+ feature = set()
+
+ if "feature" in topo:
+ feature.update(topo["feature"])
+
+ if rname in topo["routers"]:
+ for key in topo["routers"][rname].keys():
+ feature.add(key)
+
+ for val in topo["routers"][rname]["links"].values():
+ if "pim" in val:
+ feature.add("pim")
+ break
+ for val in topo["routers"][rname]["links"].values():
+ if "pim6" in val:
+ feature.add("pim6")
+ break
+ for val in topo["routers"][rname]["links"].values():
+ if "ospf6" in val:
+ feature.add("ospf6")
+ break
+ if "switches" in topo and rname in topo["switches"]:
+ for val in topo["switches"][rname]["links"].values():
+ if "ospf" in val:
+ feature.add("ospf")
+ break
+ if "ospf6" in val:
+ feature.add("ospf6")
+ break
+
+ # Loading empty zebra.conf file to router, to start the zebra deamon
router.load_config(
TopoRouter.RD_ZEBRA, "{}/{}/zebra.conf".format(tgen.logdir, rname)
)
- # Loading empty bgpd.conf file to router, to start the bgp daemon
- router.load_config(
- TopoRouter.RD_BGP, "{}/{}/bgpd.conf".format(tgen.logdir, rname)
- )
+ # Loading empty bgpd.conf file to router, to start the bgp deamon
+ if "bgp" in feature:
+ router.load_config(
+ TopoRouter.RD_BGP, "{}/{}/bgpd.conf".format(tgen.logdir, rname)
+ )
- if daemon and "ospfd" in daemon:
- # Loading empty ospf.conf file to router, to start the bgp daemon
+ # Loading empty pimd.conf file to router, to start the pim deamon
+ if "pim" in feature:
router.load_config(
- TopoRouter.RD_OSPF, "{}/{}/ospfd.conf".format(tgen.logdir, rname)
+ TopoRouter.RD_PIM, "{}/{}/pimd.conf".format(tgen.logdir, rname)
)
- if daemon and "ospf6d" in daemon:
- # Loading empty ospf.conf file to router, to start the bgp daemon
+ # Loading empty pimd.conf file to router, to start the pim deamon
+ if "pim6" in feature:
router.load_config(
- TopoRouter.RD_OSPF6, "{}/{}/ospf6d.conf".format(tgen.logdir, rname)
+ TopoRouter.RD_PIM6, "{}/{}/pim6d.conf".format(tgen.logdir, rname)
)
- if daemon and "pimd" in daemon:
- # Loading empty pimd.conf file to router, to start the pim deamon
+ if "ospf" in feature:
+ # Loading empty ospf.conf file to router, to start the ospf deamon
router.load_config(
- TopoRouter.RD_PIM, "{}/{}/pimd.conf".format(tgen.logdir, rname)
+ TopoRouter.RD_OSPF, "{}/{}/ospfd.conf".format(tgen.logdir, rname)
)
- if daemon and "pim6d" in daemon:
- # Loading empty pimd.conf file to router, to start the pim6d deamon
+ if "ospf6" in feature:
+ # Loading empty ospf.conf file to router, to start the ospf deamon
router.load_config(
- TopoRouter.RD_PIM6, "{}/{}/pim6d.conf".format(tgen.logdir, rname)
+ TopoRouter.RD_OSPF6, "{}/{}/ospf6d.conf".format(tgen.logdir, rname)
)
# Starting routers