From e82b531df94b9fd7bc456df8a1b7c58f2770eff9 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Thu, 29 Jul 2021 09:38:55 +0000 Subject: tests: remove legacy Topo class (fixes many pylint errors) Signed-off-by: Christian Hopps --- .../test_ospf_authentication.py | 28 ++++------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_authentication.py') diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py b/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py index 6d1b8d9e9d..0ddd7d517c 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py @@ -61,13 +61,6 @@ pytestmark = [pytest.mark.ospfd] # Global variables topo = None -# Reading the data from JSON File for topology creation -jsonFile = "{}/ospf_authentication.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. @@ -92,28 +85,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) @@ -121,7 +98,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_authentication.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. -- cgit v1.2.3