summaryrefslogtreecommitdiffstats
path: root/tests/topotests/bfd_topo3
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2021-08-27 20:28:29 +0200
committerChristian Hopps <chopps@labn.net>2021-09-04 15:04:46 +0200
commit8db751b853560377ebd640c729ecb4e155e6a6d7 (patch)
tree51a8419faf7cc64401f05b13c95a30895c5cd2f9 /tests/topotests/bfd_topo3
parenttests: micronet: update infra (diff)
downloadfrr-8db751b853560377ebd640c729ecb4e155e6a6d7.tar.xz
frr-8db751b853560377ebd640c729ecb4e155e6a6d7.zip
tests: micronet: adapt tests
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/topotests/bfd_topo3')
-rw-r--r--tests/topotests/bfd_topo3/test_bfd_topo3.py35
1 files changed, 7 insertions, 28 deletions
diff --git a/tests/topotests/bfd_topo3/test_bfd_topo3.py b/tests/topotests/bfd_topo3/test_bfd_topo3.py
index 6bb223e20..9ed8f5fcb 100644
--- a/tests/topotests/bfd_topo3/test_bfd_topo3.py
+++ b/tests/topotests/bfd_topo3/test_bfd_topo3.py
@@ -39,42 +39,21 @@ sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib import topotest
+from lib.micronet_compat import Topo
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
-# Required to instantiate the topology builder class.
-from mininet.topo import Topo
-
pytestmark = [pytest.mark.bfdd, pytest.mark.bgpd]
-class BFDTopo(Topo):
- "Test topology builder"
-
- 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))
-
- 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("s3")
- switch.add_link(tgen.gears["r3"])
- switch.add_link(tgen.gears["r4"])
-
-
def setup_module(mod):
"Sets up the pytest environment"
- tgen = Topogen(BFDTopo, mod.__name__)
+ topodef = {
+ "s1": ("r1", "r2"),
+ "s2": ("r2", "r3"),
+ "s3": ("r3", "r4"),
+ }
+ tgen = Topogen(topodef, mod.__name__)
tgen.start_topology()
router_list = tgen.routers()