summaryrefslogtreecommitdiff
path: root/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py')
-rw-r--r--tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py43
1 files changed, 5 insertions, 38 deletions
diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py
index 860f17ba67..d8f659e5a9 100644
--- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py
+++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_rte_calc.py
@@ -25,10 +25,6 @@ import os
import sys
import time
import pytest
-import json
-from copy import deepcopy
-from ipaddress import IPv4Address
-from lib.topotest import frr_unicode
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
@@ -37,10 +33,8 @@ 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 ipaddress
-from lib.bgp import verify_bgp_convergence, create_router_bgp
# Import topoJson from lib, to create topology and initial configuration
from lib.common_config import (
@@ -49,9 +43,7 @@ from lib.common_config import (
write_test_footer,
reset_config_on_routers,
verify_rib,
- create_static_routes,
step,
- create_route_maps,
shutdown_bringup_interface,
create_interfaces_cfg,
topo_daemons,
@@ -59,20 +51,16 @@ from lib.common_config import (
)
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_ospf6_neighbor,
- config_ospf_interface,
- clear_ospf,
verify_ospf6_rib,
create_router_ospf,
verify_ospf6_interface,
- verify_ospf6_database,
config_ospf6_interface,
)
-from ipaddress import IPv6Address
pytestmark = [pytest.mark.ospfd, pytest.mark.staticd]
@@ -80,14 +68,6 @@ pytestmark = [pytest.mark.ospfd, pytest.mark.staticd]
# Global variables
topo = None
-# Reading the data from JSON File for topology creation
-jsonFile = "{}/ospfv3_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 = {
"ipv6": [
"11.0.20.1/32",
@@ -119,28 +99,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 +112,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_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.