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/ospf_topo2/test_ospf_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/ospf_topo2/test_ospf_topo2.py')
| -rw-r--r-- | tests/topotests/ospf_topo2/test_ospf_topo2.py | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/tests/topotests/ospf_topo2/test_ospf_topo2.py b/tests/topotests/ospf_topo2/test_ospf_topo2.py index 38d424c906..696396d68a 100644 --- a/tests/topotests/ospf_topo2/test_ospf_topo2.py +++ b/tests/topotests/ospf_topo2/test_ospf_topo2.py @@ -49,34 +49,32 @@ from lib.micronet_compat import Topo pytestmark = [pytest.mark.ospfd] -class OSPFTopo(Topo): - "Test topology builder" +CWD = os.path.dirname(os.path.realpath(__file__)) - def build(self, *_args, **_opts): - "Build function" - tgen = get_topogen(self) +def build_topo(tgen): + "Build function" - # Create 4 routers - for routern in range(1, 3): - tgen.add_router("r{}".format(routern)) + # Create 4 routers + for routern in range(1, 3): + tgen.add_router("r{}".format(routern)) - # Create a empty network for router 1 - switch = tgen.add_switch("s1") - switch.add_link(tgen.gears["r1"]) + # Create a empty network for router 1 + switch = tgen.add_switch("s1") + switch.add_link(tgen.gears["r1"]) - # Create a empty network for router 2 - switch = tgen.add_switch("s2") - switch.add_link(tgen.gears["r2"]) + # Create a empty network for router 2 + switch = tgen.add_switch("s2") + switch.add_link(tgen.gears["r2"]) - # Interconect router 1, 2 - switch = tgen.add_switch("s3") - switch.add_link(tgen.gears["r1"]) - switch.add_link(tgen.gears["r2"]) + # Interconect router 1, 2 + switch = tgen.add_switch("s3") + switch.add_link(tgen.gears["r1"]) + switch.add_link(tgen.gears["r2"]) def setup_module(mod): "Sets up the pytest environment" - tgen = Topogen(OSPFTopo, mod.__name__) + tgen = Topogen(build_topo, mod.__name__) tgen.start_topology() router_list = tgen.routers() |
