summaryrefslogtreecommitdiffstats
path: root/tests/topotests/bgp_route_aggregation
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2021-07-29 11:38:55 +0200
committerChristian Hopps <chopps@labn.net>2021-09-04 15:04:46 +0200
commite82b531df94b9fd7bc456df8a1b7c58f2770eff9 (patch)
treec5b8812d719c905bec58db38a2f0800be675c0e5 /tests/topotests/bgp_route_aggregation
parenttests: fix pylint test errors (diff)
downloadfrr-e82b531df94b9fd7bc456df8a1b7c58f2770eff9.tar.xz
frr-e82b531df94b9fd7bc456df8a1b7c58f2770eff9.zip
tests: remove legacy Topo class (fixes many pylint errors)
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/topotests/bgp_route_aggregation')
-rw-r--r--tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py30
1 files changed, 5 insertions, 25 deletions
diff --git a/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py b/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
index 8297085ff..007e640f5 100644
--- a/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
+++ b/tests/topotests/bgp_route_aggregation/test_bgp_aggregation.py
@@ -70,16 +70,8 @@ from lib.bgp import (
)
from lib.topojson import build_topo_from_json, build_config_from_json
-pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
-
-# Reading the data from JSON File for topology and configuration creation
-jsonFile = "{}/bgp_aggregation.json".format(CWD)
-try:
- with open(jsonFile, "r") as topoJson:
- topo = json.load(topoJson)
-except IOError:
- logger.info("Could not read file:", jsonFile)
+pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
# Global variables
BGP_CONVERGENCE = False
@@ -113,21 +105,6 @@ COMMUNITY = [
]
-class CreateTopo(Topo):
- """
- Test BasicTopo - topology 1
-
- * `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
@@ -142,7 +119,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 = "{}/bgp_aggregation.json".format(CWD)
+ tgen = Topogen(json_file, mod.__name__)
+ global topo
+ topo = tgen.json_topo
# ... and here it calls Mininet initialization functions.
# Starting topology, create tmp files which are loaded to routers