from lib.topogen import Topogen, get_topogen
# Required to instantiate the topology builder class.
-from mininet.topo import Topo
# Import topoJson from lib, to create topology and initial configuration
from lib.common_config import (
input_dict = {}
-class TemplateTopo(Topo):
- """
- Test topology builder
-
- * `Topo`: Topology object
- """
-
- def build(self, *_args, **_opts):
- "Build function"
- tgen = get_topogen(self)
+def build_topo(tgen):
+ "Build function"
- # This function only purpose is to create topology
- # as defined in input json file.
- #
- # Example
- #
- # Creating 2 routers having single links in between,
- # which is used to establised BGP neighborship
+ # This function only purpose is to create topology
+ # as defined in input json file.
+ #
+ # Example
+ #
+ # Creating 2 routers having single links in between,
+ # which is used to establised BGP neighborship
- # Building topology from json file
- build_topo_from_json(tgen, topo)
+ # Building topology from json file
+ build_topo_from_json(tgen, topo)
def setup_module(mod):
logger.info("Running setup_module to create topology")
# This function initiates the topology build with Topogen...
- tgen = Topogen(TemplateTopo, mod.__name__)
+ tgen = Topogen(build_topo, mod.__name__)
# ... and here it calls Mininet initialization functions.
# Starting topology, create tmp files which are loaded to routers
def test_bgp_convergence(request):
- " Test BGP daemon convergence "
+ "Test BGP daemon convergence"
tgen = get_topogen()
global bgp_convergence
def test_static_routes(request):
- " Test to create and verify static routes. "
+ "Test to create and verify static routes."
tgen = get_topogen()
if bgp_convergence is not True: