summaryrefslogtreecommitdiff
path: root/tests/topotests/isis_sr_topo1
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2021-07-29 09:38:55 +0000
committerChristian Hopps <chopps@labn.net>2021-09-04 09:04:46 -0400
commite82b531df94b9fd7bc456df8a1b7c58f2770eff9 (patch)
treec5b8812d719c905bec58db38a2f0800be675c0e5 /tests/topotests/isis_sr_topo1
parentd7d21c3a190f7754afe4d5b969501756a3739e48 (diff)
tests: remove legacy Topo class (fixes many pylint errors)
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/topotests/isis_sr_topo1')
-rw-r--r--tests/topotests/isis_sr_topo1/test_isis_sr_topo1.py76
1 files changed, 36 insertions, 40 deletions
diff --git a/tests/topotests/isis_sr_topo1/test_isis_sr_topo1.py b/tests/topotests/isis_sr_topo1/test_isis_sr_topo1.py
index 8aa187871c..a8956bb57e 100644
--- a/tests/topotests/isis_sr_topo1/test_isis_sr_topo1.py
+++ b/tests/topotests/isis_sr_topo1/test_isis_sr_topo1.py
@@ -87,59 +87,55 @@ from lib.micronet_compat import Topo
pytestmark = [pytest.mark.isisd]
-class TemplateTopo(Topo):
- "Test topology builder"
+def build_topo(tgen):
+ "Build function"
- def build(self, *_args, **_opts):
- "Build function"
- tgen = get_topogen(self)
+ #
+ # Define FRR Routers
+ #
+ for router in ["rt1", "rt2", "rt3", "rt4", "rt5", "rt6"]:
+ tgen.add_router(router)
- #
- # Define FRR Routers
- #
- for router in ["rt1", "rt2", "rt3", "rt4", "rt5", "rt6"]:
- tgen.add_router(router)
+ #
+ # Define connections
+ #
+ switch = tgen.add_switch("s1")
+ switch.add_link(tgen.gears["rt1"], nodeif="eth-sw1")
+ switch.add_link(tgen.gears["rt2"], nodeif="eth-sw1")
+ switch.add_link(tgen.gears["rt3"], nodeif="eth-sw1")
- #
- # Define connections
- #
- switch = tgen.add_switch("s1")
- switch.add_link(tgen.gears["rt1"], nodeif="eth-sw1")
- switch.add_link(tgen.gears["rt2"], nodeif="eth-sw1")
- switch.add_link(tgen.gears["rt3"], nodeif="eth-sw1")
+ switch = tgen.add_switch("s2")
+ switch.add_link(tgen.gears["rt2"], nodeif="eth-rt4-1")
+ switch.add_link(tgen.gears["rt4"], nodeif="eth-rt2-1")
- switch = tgen.add_switch("s2")
- switch.add_link(tgen.gears["rt2"], nodeif="eth-rt4-1")
- switch.add_link(tgen.gears["rt4"], nodeif="eth-rt2-1")
+ switch = tgen.add_switch("s3")
+ switch.add_link(tgen.gears["rt2"], nodeif="eth-rt4-2")
+ switch.add_link(tgen.gears["rt4"], nodeif="eth-rt2-2")
- switch = tgen.add_switch("s3")
- switch.add_link(tgen.gears["rt2"], nodeif="eth-rt4-2")
- switch.add_link(tgen.gears["rt4"], nodeif="eth-rt2-2")
+ switch = tgen.add_switch("s4")
+ switch.add_link(tgen.gears["rt3"], nodeif="eth-rt5-1")
+ switch.add_link(tgen.gears["rt5"], nodeif="eth-rt3-1")
- switch = tgen.add_switch("s4")
- switch.add_link(tgen.gears["rt3"], nodeif="eth-rt5-1")
- switch.add_link(tgen.gears["rt5"], nodeif="eth-rt3-1")
+ switch = tgen.add_switch("s5")
+ switch.add_link(tgen.gears["rt3"], nodeif="eth-rt5-2")
+ switch.add_link(tgen.gears["rt5"], nodeif="eth-rt3-2")
- switch = tgen.add_switch("s5")
- switch.add_link(tgen.gears["rt3"], nodeif="eth-rt5-2")
- switch.add_link(tgen.gears["rt5"], nodeif="eth-rt3-2")
+ switch = tgen.add_switch("s6")
+ switch.add_link(tgen.gears["rt4"], nodeif="eth-rt5")
+ switch.add_link(tgen.gears["rt5"], nodeif="eth-rt4")
- switch = tgen.add_switch("s6")
- switch.add_link(tgen.gears["rt4"], nodeif="eth-rt5")
- switch.add_link(tgen.gears["rt5"], nodeif="eth-rt4")
+ switch = tgen.add_switch("s7")
+ switch.add_link(tgen.gears["rt4"], nodeif="eth-rt6")
+ switch.add_link(tgen.gears["rt6"], nodeif="eth-rt4")
- switch = tgen.add_switch("s7")
- switch.add_link(tgen.gears["rt4"], nodeif="eth-rt6")
- switch.add_link(tgen.gears["rt6"], nodeif="eth-rt4")
-
- switch = tgen.add_switch("s8")
- switch.add_link(tgen.gears["rt5"], nodeif="eth-rt6")
- switch.add_link(tgen.gears["rt6"], nodeif="eth-rt5")
+ switch = tgen.add_switch("s8")
+ switch.add_link(tgen.gears["rt5"], nodeif="eth-rt6")
+ switch.add_link(tgen.gears["rt6"], nodeif="eth-rt5")
def setup_module(mod):
"Sets up the pytest environment"
- tgen = Topogen(TemplateTopo, mod.__name__)
+ tgen = Topogen(build_topo, mod.__name__)
tgen.start_topology()
router_list = tgen.routers()