summaryrefslogtreecommitdiffstats
path: root/tests/topotests/isis_topo1_vrf
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/isis_topo1_vrf
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/isis_topo1_vrf')
-rw-r--r--tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py72
1 files changed, 34 insertions, 38 deletions
diff --git a/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py b/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py
index 9c15ee342..620fc333b 100644
--- a/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py
+++ b/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py
@@ -61,48 +61,44 @@ VERTEX_TYPE_LIST = [
]
-class ISISTopo1(Topo):
- "Simple two layer ISIS vrf topology"
-
- def build(self, *_args, **_opts):
- "Build function"
- tgen = get_topogen(self)
-
- # Add ISIS routers:
- # r1 r2
- # | sw1 | sw2
- # r3 r4
- # | |
- # sw3 sw4
- # \ /
- # r5
- for routern in range(1, 6):
- tgen.add_router("r{}".format(routern))
-
- # r1 <- sw1 -> r3
- sw = tgen.add_switch("sw1")
- sw.add_link(tgen.gears["r1"])
- sw.add_link(tgen.gears["r3"])
-
- # r2 <- sw2 -> r4
- sw = tgen.add_switch("sw2")
- sw.add_link(tgen.gears["r2"])
- sw.add_link(tgen.gears["r4"])
-
- # r3 <- sw3 -> r5
- sw = tgen.add_switch("sw3")
- sw.add_link(tgen.gears["r3"])
- sw.add_link(tgen.gears["r5"])
-
- # r4 <- sw4 -> r5
- sw = tgen.add_switch("sw4")
- sw.add_link(tgen.gears["r4"])
- sw.add_link(tgen.gears["r5"])
+def build_topo(tgen):
+ "Build function"
+
+ # Add ISIS routers:
+ # r1 r2
+ # | sw1 | sw2
+ # r3 r4
+ # | |
+ # sw3 sw4
+ # \ /
+ # r5
+ for routern in range(1, 6):
+ tgen.add_router("r{}".format(routern))
+
+ # r1 <- sw1 -> r3
+ sw = tgen.add_switch("sw1")
+ sw.add_link(tgen.gears["r1"])
+ sw.add_link(tgen.gears["r3"])
+
+ # r2 <- sw2 -> r4
+ sw = tgen.add_switch("sw2")
+ sw.add_link(tgen.gears["r2"])
+ sw.add_link(tgen.gears["r4"])
+
+ # r3 <- sw3 -> r5
+ sw = tgen.add_switch("sw3")
+ sw.add_link(tgen.gears["r3"])
+ sw.add_link(tgen.gears["r5"])
+
+ # r4 <- sw4 -> r5
+ sw = tgen.add_switch("sw4")
+ sw.add_link(tgen.gears["r4"])
+ sw.add_link(tgen.gears["r5"])
def setup_module(mod):
"Sets up the pytest environment"
- tgen = Topogen(ISISTopo1, mod.__name__)
+ tgen = Topogen(build_topo, mod.__name__)
tgen.start_topology()
logger.info("Testing with VRF Lite support")