summaryrefslogtreecommitdiff
path: root/tests/topotests/ospf_dual_stack/test_ospf_dual_stack.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/ospf_dual_stack/test_ospf_dual_stack.py')
-rw-r--r--tests/topotests/ospf_dual_stack/test_ospf_dual_stack.py24
1 files changed, 4 insertions, 20 deletions
diff --git a/tests/topotests/ospf_dual_stack/test_ospf_dual_stack.py b/tests/topotests/ospf_dual_stack/test_ospf_dual_stack.py
index f4d98fddb8..fda9892f29 100644
--- a/tests/topotests/ospf_dual_stack/test_ospf_dual_stack.py
+++ b/tests/topotests/ospf_dual_stack/test_ospf_dual_stack.py
@@ -48,29 +48,10 @@ pytestmark = [pytest.mark.ospfd, pytest.mark.staticd]
# Global variables
topo = None
-# Reading the data from JSON File for topology creation
-jsonFile = "{}/test_ospf_dual_stack.json".format(CWD)
-try:
- with open(jsonFile, "r") as topoJson:
- topo = json.load(topoJson)
-except IOError:
- assert False, "Could not read file {}".format(jsonFile)
-
-
-class CreateTopo(Topo):
- """Test topology builder."""
-
- def build(self, *_args, **_opts):
- """Build function."""
- tgen = get_topogen(self)
-
- # Building topology from json file
- build_topo_from_json(tgen, topo)
def setup_module(mod):
"""Sets up the pytest environment."""
- global topo
testsuite_run_time = time.asctime(time.localtime(time.time()))
logger.info("Testsuite start time: {}".format(testsuite_run_time))
logger.info("=" * 40)
@@ -78,7 +59,10 @@ def setup_module(mod):
logger.info("Running setup_module to create topology")
# This function initiates the topology build with Topogen...
- tgen = Topogen(CreateTopo, mod.__name__)
+ json_file = "{}/test_ospf_dual_stack.json".format(CWD)
+ tgen = Topogen(json_file, mod.__name__)
+ global topo
+ topo = tgen.json_topo
# ... and here it calls Mininet initialization functions.
# get list of daemons needs to be started for this suite.