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/ospf6_topo2/test_ospf6_topo2.py | |
| 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/ospf6_topo2/test_ospf6_topo2.py')
| -rw-r--r-- | tests/topotests/ospf6_topo2/test_ospf6_topo2.py | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py index e64000b077..c1ff243fdf 100644 --- a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py +++ b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py @@ -95,33 +95,29 @@ def expect_ospfv3_routes(router, routes, wait=5, detail=False): assert result is None, assertmsg -class OSPFv3Topo2(Topo): - "Test topology builder" +def build_topo(tgen): + "Build function" - def build(self, *_args, **_opts): - "Build function" - tgen = get_topogen(self) + # Create 4 routers + for routern in range(1, 5): + tgen.add_router("r{}".format(routern)) - # Create 4 routers - for routern in range(1, 5): - 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"]) + switch = tgen.add_switch("s2") + switch.add_link(tgen.gears["r2"]) + switch.add_link(tgen.gears["r3"]) - switch = tgen.add_switch("s2") - switch.add_link(tgen.gears["r2"]) - switch.add_link(tgen.gears["r3"]) - - switch = tgen.add_switch("s3") - switch.add_link(tgen.gears["r2"]) - switch.add_link(tgen.gears["r4"]) + switch = tgen.add_switch("s3") + switch.add_link(tgen.gears["r2"]) + switch.add_link(tgen.gears["r4"]) def setup_module(mod): "Sets up the pytest environment" - tgen = Topogen(OSPFv3Topo2, mod.__name__) + tgen = Topogen(build_topo, mod.__name__) tgen.start_topology() router_list = tgen.routers() |
