diff options
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py')
| -rw-r--r-- | tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py index eb1c3a914c..9ca46082d1 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp_lan.py @@ -76,14 +76,6 @@ pytestmark = [pytest.mark.ospfd, pytest.mark.staticd] # Global variables topo = None # Reading the data from JSON File for topology creation - -jsonFile = "{}/ospf_ecmp_lan.json".format(CWD) -try: - with open(jsonFile, "r") as topoJson: - topo = json.load(topoJson) -except IOError: - assert False, "Could not read file {}".format(jsonFile) - NETWORK = { "ipv4": [ "11.0.20.1/32", @@ -119,28 +111,12 @@ TESTCASES = """ -class CreateTopo(Topo): - """ - Test topology builder. - - * `Topo`: Topology object - """ - - 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 * `mod`: module name """ - global topo testsuite_run_time = time.asctime(time.localtime(time.time())) logger.info("Testsuite start time: {}".format(testsuite_run_time)) logger.info("=" * 40) @@ -148,7 +124,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 = "{}/ospf_ecmp_lan.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. |
