diff options
Diffstat (limited to 'tests/topotests/ospf_gr_helper')
-rw-r--r-- | tests/topotests/ospf_gr_helper/test_ospf_gr_helper.py | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper.py b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper.py index 536382213..6e3147bd0 100644 --- a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper.py +++ b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper.py @@ -37,7 +37,6 @@ sys.path.append(os.path.join(CWD, "../")) # 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 @@ -76,14 +75,6 @@ intf = None intf1 = None pkt = None -# Reading the data from JSON File for topology creation -jsonFile = "{}/ospf_gr_helper.json".format(CWD) -try: - with open(jsonFile, "r") as topoJson: - topo = json.load(topoJson) -except IOError: - assert False, "Could not read file {}".format(jsonFile) - """ Topology: @@ -118,21 +109,6 @@ TC8. Verify helper functionality when dut is helping RR and new grace lsa """ -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 @@ -147,7 +123,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_gr_helper.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. @@ -169,7 +148,7 @@ def setup_module(mod): ospf_covergence ) - sw_name = topo["switches"].keys()[0] + sw_name = "s1" intf = topo["routers"]["r0"]["links"][sw_name]["interface"] intf1 = topo["routers"]["r1"]["links"][sw_name]["interface"] pkt = topo["routers"]["r1"]["opq_lsa_hex"] |