diff options
| author | Christian Hopps <chopps@labn.net> | 2021-07-29 09:38:55 +0000 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2021-09-04 09:04:46 -0400 |
| commit | e82b531df94b9fd7bc456df8a1b7c58f2770eff9 (patch) | |
| tree | c5b8812d719c905bec58db38a2f0800be675c0e5 /tests/topotests/bgp_lu_topo1 | |
| parent | d7d21c3a190f7754afe4d5b969501756a3739e48 (diff) | |
tests: remove legacy Topo class (fixes many pylint errors)
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/topotests/bgp_lu_topo1')
| -rw-r--r-- | tests/topotests/bgp_lu_topo1/test_bgp_lu.py | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/tests/topotests/bgp_lu_topo1/test_bgp_lu.py b/tests/topotests/bgp_lu_topo1/test_bgp_lu.py index 258ddb148d..6318044eaa 100644 --- a/tests/topotests/bgp_lu_topo1/test_bgp_lu.py +++ b/tests/topotests/bgp_lu_topo1/test_bgp_lu.py @@ -62,37 +62,33 @@ pytestmark = [pytest.mark.bgpd] # +-----+ +-----+ +-----+ -class TemplateTopo(Topo): - "Test topology builder" +def build_topo(tgen): + "Build function" - def build(self, *_args, **_opts): - "Build function" - tgen = get_topogen(self) + # This function only purpose is to define allocation and relationship + # between routers, switches and hosts. + # + # + # Create routers + tgen.add_router("R1") + tgen.add_router("R2") + tgen.add_router("R3") - # This function only purpose is to define allocation and relationship - # between routers, switches and hosts. - # - # - # Create routers - tgen.add_router("R1") - tgen.add_router("R2") - tgen.add_router("R3") + # R1-R2 + switch = tgen.add_switch("s1") + switch.add_link(tgen.gears["R1"]) + switch.add_link(tgen.gears["R2"]) - # R1-R2 - switch = tgen.add_switch("s1") - switch.add_link(tgen.gears["R1"]) - switch.add_link(tgen.gears["R2"]) - - # R2-R3 - switch = tgen.add_switch("s2") - switch.add_link(tgen.gears["R2"]) - switch.add_link(tgen.gears["R3"]) + # R2-R3 + switch = tgen.add_switch("s2") + switch.add_link(tgen.gears["R2"]) + switch.add_link(tgen.gears["R3"]) def setup_module(mod): "Sets up the pytest environment" # This function initiates the topology build with Topogen... - tgen = Topogen(TemplateTopo, mod.__name__) + tgen = Topogen(build_topo, mod.__name__) # ... and here it calls Mininet initialization functions. tgen.start_topology() |
