diff options
| author | Christian Hopps <chopps@labn.net> | 2021-07-29 09:38:55 +0000 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2021-09-04 09:04:46 -0400 |
| commit | e82b531df94b9fd7bc456df8a1b7c58f2770eff9 (patch) | |
| tree | c5b8812d719c905bec58db38a2f0800be675c0e5 /tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py | |
| parent | d7d21c3a190f7754afe4d5b969501756a3739e48 (diff) | |
tests: remove legacy Topo class (fixes many pylint errors)
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py')
| -rw-r--r-- | tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py index 22593babaa..969e9c45b1 100644 --- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py +++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py @@ -78,14 +78,6 @@ pytestmark = [pytest.mark.ospfd, pytest.mark.staticd] # Global variables topo = None -# Reading the data from JSON File for topology creation -jsonFile = "{}/ospfv3_single_area.json".format(CWD) -try: - with open(jsonFile, "r") as topoJson: - topo = json.load(topoJson) -except IOError: - assert False, "Could not read file {}".format(jsonFile) - """ TOPOOLOGY = Please view in a fixed-width font such as Courier. @@ -111,28 +103,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) @@ -140,7 +116,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 = "{}/ospfv3_single_area.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. |
