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_minimum_holdtime | |
| 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_minimum_holdtime')
| -rwxr-xr-x | tests/topotests/bgp_minimum_holdtime/test_bgp_minimum_holdtime.py | 17 | 
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/topotests/bgp_minimum_holdtime/test_bgp_minimum_holdtime.py b/tests/topotests/bgp_minimum_holdtime/test_bgp_minimum_holdtime.py index c5afcdf112..5facdd26ea 100755 --- a/tests/topotests/bgp_minimum_holdtime/test_bgp_minimum_holdtime.py +++ b/tests/topotests/bgp_minimum_holdtime/test_bgp_minimum_holdtime.py @@ -41,20 +41,17 @@ from mininet.topo import Topo  pytestmark = [pytest.mark.bgpd] -class TemplateTopo(Topo): -    def build(self, *_args, **_opts): -        tgen = get_topogen(self) +def build_topo(tgen): +    for routern in range(1, 3): +        tgen.add_router("r{}".format(routern)) -        for routern in range(1, 3): -            tgen.add_router("r{}".format(routern)) - -        switch = tgen.add_switch("s1") -        switch.add_link(tgen.gears["r1"]) -        switch.add_link(tgen.gears["r2"]) +    switch = tgen.add_switch("s1") +    switch.add_link(tgen.gears["r1"]) +    switch.add_link(tgen.gears["r2"])  def setup_module(mod): -    tgen = Topogen(TemplateTopo, mod.__name__) +    tgen = Topogen(build_topo, mod.__name__)      tgen.start_topology()      router_list = tgen.routers()  | 
