summaryrefslogtreecommitdiffstats
path: root/tests/topotests/bgp_conditional_advertisement
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_conditional_advertisement
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_conditional_advertisement')
-rw-r--r--tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py b/tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py
index 9e020ae86..02fcd5445 100644
--- a/tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py
+++ b/tests/topotests/bgp_conditional_advertisement/test_bgp_conditional_advertisement.py
@@ -142,21 +142,18 @@ from lib.micronet_compat import Topo
pytestmark = [pytest.mark.bgpd]
-class BgpConditionalAdvertisementTopo(Topo):
- def build(self, *_args, **_opts):
- tgen = get_topogen(self)
+def build_topo(tgen):
+ r1 = tgen.add_router("r1")
+ r2 = tgen.add_router("r2")
+ r3 = tgen.add_router("r3")
- r1 = tgen.add_router("r1")
- r2 = tgen.add_router("r2")
- r3 = tgen.add_router("r3")
+ switch = tgen.add_switch("s1")
+ switch.add_link(r1)
+ switch.add_link(r2)
- switch = tgen.add_switch("s1")
- switch.add_link(r1)
- switch.add_link(r2)
-
- switch = tgen.add_switch("s2")
- switch.add_link(r2)
- switch.add_link(r3)
+ switch = tgen.add_switch("s2")
+ switch.add_link(r2)
+ switch.add_link(r3)
def setup_module(mod):
@@ -166,7 +163,7 @@ def setup_module(mod):
logger.info("Running setup_module to create topology")
- tgen = Topogen(BgpConditionalAdvertisementTopo, mod.__name__)
+ tgen = Topogen(build_topo, mod.__name__)
tgen.start_topology()
router_list = tgen.routers()