diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2021-09-04 12:20:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-04 12:20:00 -0400 |
| commit | 5653bb515c97119661f37c6571de0164a2274744 (patch) | |
| tree | 0339eb1bb7da05987f447e9f24d01b7d1b6bb2b0 /tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py | |
| parent | 3b934c400626e27b89a3bd7fce003b56783cb88e (diff) | |
| parent | a53c08bc131c02f4a20931d7aa9f974194ab16e7 (diff) | |
Merge pull request #9199 from LabNConsulting/chopps/micronet-prime
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py')
| -rw-r--r-- | tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py b/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py index 0e2fef4a22..fb96054dbc 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py @@ -27,7 +27,6 @@ import sys import time import pytest import ipaddress -import json # Save the Current Working Directory to find configuration files. CWD = os.path.dirname(os.path.realpath(__file__)) @@ -36,7 +35,6 @@ sys.path.append(os.path.join(CWD, "../lib/")) # pylint: disable=C0413 # Import topogen and topotest helpers -from mininet.topo import Topo from lib.topogen import Topogen, get_topogen # Import topoJson from lib, to create topology and initial configuration @@ -54,13 +52,12 @@ from lib.common_config import ( ) from lib.bgp import verify_bgp_convergence, create_router_bgp from lib.topolog import logger -from lib.topojson import build_topo_from_json, build_config_from_json +from lib.topojson import build_config_from_json from lib.ospf import ( verify_ospf_neighbor, clear_ospf, verify_ospf_rib, - create_router_ospf, redistribute_ospf, config_ospf_interface, verify_ospf_interface, @@ -75,14 +72,6 @@ topo = None # number of retries. nretry = 5 -# Reading the data from JSON File for topology creation -jsonFile = "{}/ospf_rte_calc.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", @@ -115,28 +104,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) @@ -144,7 +117,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_rte_calc.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. |
