Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: stop using fifos in bgp...multipath_relax #1

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
35ee15f
zebra: add temp warning (do not merge)
choppsv1 Jul 19, 2021
de53896
tests: simple fast static test
choppsv1 Jul 23, 2021
22ef8ed
tests: Run tests in a collection of containers
choppsv1 Jul 18, 2021
a287499
tests: summarize XML test results
choppsv1 Jul 18, 2021
73e90a4
tests: Update dir-locals
choppsv1 Jul 14, 2021
65ddecb
doc: minor update based on mininet removal
choppsv1 Jul 18, 2021
195d98c
tests: reasonable defaults for pytest results+logging
choppsv1 Jul 20, 2021
4cec960
tests: improve vxlan test determinism
choppsv1 Jul 18, 2021
57a576b
tests: NEW micronet replacement for mininet
choppsv1 Jul 14, 2021
fced6f1
tests: update infra for micronet
choppsv1 Jul 26, 2021
320e4ec
tests: fix pylint infra errors
choppsv1 Jul 21, 2021
c0dddb3
tests: fix pylint test errors
choppsv1 Jul 29, 2021
42ff766
tests: update tests for micronet
choppsv1 Jul 30, 2021
11a272d
tests: remove legacy Topo class (fixes many pylint errors)
choppsv1 Jul 29, 2021
6ab60b1
tests: remove legacy Topo class from infra
choppsv1 Aug 10, 2021
a93dc9d
tests: remove legacy Topo class from micronet
choppsv1 Aug 10, 2021
432fdf0
tests: add helper object for mcast-tester and iperf tool.
choppsv1 Jul 30, 2021
7d0201e
tests: use new helper object for mcast-tester and iperf
choppsv1 Jul 30, 2021
5ee5768
tests: keep revisions of configs
choppsv1 Aug 1, 2021
f3d6c8d
tests: triage intermittent ospfd failure in CI
choppsv1 Aug 4, 2021
4280118
tests: add triage show commands to ospf test
choppsv1 Aug 4, 2021
c64556f
tools: move frr-reload.py to python3 explicitly
choppsv1 Aug 4, 2021
e0a8cdf
docker: update with micronet changes
choppsv1 Aug 6, 2021
9d13373
tests: add back a 10 second delay to see if this fixes the failures
choppsv1 Aug 6, 2021
096bd1b
ospfd: Summarised External LSA is not flushed in one scenario
mobash-rasool Aug 16, 2021
7f5d7f2
tests: remove unneeded mcast group kernel routes and sysctl
choppsv1 Aug 18, 2021
906eef4
tests: Make bgp_multiview_topo1 predictable
mwinter-osr Aug 18, 2021
ae4f7ed
tests: use std polling for results
choppsv1 Aug 21, 2021
720c420
tests: add generic exa-receive.py script
choppsv1 Aug 22, 2021
679d8df
tests: use common exa-receive.py script
choppsv1 Aug 22, 2021
f73a705
tests: temp increase post fail check time to 10 times the timeout
choppsv1 Aug 22, 2021
26d99e9
tests: stop using fifos in bgp...multipath_relax
eqvinox Aug 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tests: update tests for micronet
Signed-off-by: Christian Hopps <chopps@labn.net>
  • Loading branch information
choppsv1 committed Aug 22, 2021
commit 42ff766eef09d82ff098f64f16f462fb9b01c625
19 changes: 6 additions & 13 deletions tests/topotests/all_protocol_startup/test_all_protocol_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
import glob
from time import sleep

from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Node, OVSSwitch, Host
from mininet.log import setLogLevel, info
from mininet.cli import CLI
from mininet.link import Intf
from lib.micronet_compat import Mininet, Topo

from functools import partial

Expand Down Expand Up @@ -82,7 +77,7 @@ def build(self, **_opts):
switch = {}
#
for i in range(0, 10):
switch[i] = self.addSwitch("sw%s" % i, cls=topotest.LegacySwitch)
switch[i] = self.addSwitch("sw%s" % i)
self.addLink(switch[i], router[1], intfName2="r1-eth%s" % i)


Expand Down Expand Up @@ -765,7 +760,7 @@ def test_ospfv2_interfaces():
)
# Mask out Bandwidth portion. They may change..
actual = re.sub(r"BW [0-9]+ Mbit", "BW XX Mbit", actual)
actual = re.sub(r"ifindex [0-9]", "ifindex X", actual)
actual = re.sub(r"ifindex [0-9]+", "ifindex X", actual)

# Drop time in next due
actual = re.sub(r"Hello due in [0-9\.]+s", "Hello due in XX.XXXs", actual)
Expand Down Expand Up @@ -1155,7 +1150,7 @@ def test_nht():
expected = ("\n".join(expected.splitlines()) + "\n").splitlines(1)

actual = net["r%s" % i].cmd('vtysh -c "show ip nht" 2> /dev/null').rstrip()
actual = re.sub(r"fd [0-9][0-9]", "fd XX", actual)
actual = re.sub(r"fd [0-9]+", "fd XX", actual)
actual = ("\n".join(actual.splitlines()) + "\n").splitlines(1)

diff = topotest.get_textdiff(
Expand All @@ -1175,7 +1170,7 @@ def test_nht():
expected = ("\n".join(expected.splitlines()) + "\n").splitlines(1)

actual = net["r%s" % i].cmd('vtysh -c "show ipv6 nht" 2> /dev/null').rstrip()
actual = re.sub(r"fd [0-9][0-9]", "fd XX", actual)
actual = re.sub(r"fd [0-9]+", "fd XX", actual)
actual = ("\n".join(actual.splitlines()) + "\n").splitlines(1)

diff = topotest.get_textdiff(
Expand Down Expand Up @@ -1418,7 +1413,7 @@ def test_nexthop_groups_with_route_maps():
net["r1"].cmd('vtysh -c "sharp remove routes %s 1"' % route_str)
net["r1"].cmd('vtysh -c "c t" -c "no ip protocol sharp route-map NH-SRC"')
net["r1"].cmd(
'vtysh -c "c t" -c "no route-map NH-SRC permit 111" -c "set src %s"' % src_str
'vtysh -c "c t" -c "no route-map NH-SRC permit 111" # -c "set src %s"' % src_str
)
net["r1"].cmd('vtysh -c "c t" -c "no route-map NH-SRC"')

Expand Down Expand Up @@ -1659,8 +1654,6 @@ def test_shutdown_check_memleak():


if __name__ == "__main__":

setLogLevel("info")
# To suppress tracebacks, either use the following pytest call or add "--tb=no" to cli
# retval = pytest.main(["-s", "--tb=no"])
retval = pytest.main(["-s"])
Expand Down
30 changes: 6 additions & 24 deletions tests/topotests/bfd_bgp_cbit_topo3/test_bfd_bgp_cbit_topo3.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,17 @@
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.bgpd, pytest.mark.bfdd]


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, 4):
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"])


def setup_module(mod):
"Sets up the pytest environment"
tgen = Topogen(BFDTopo, mod.__name__)
from collections import OrderedDict
topodef = {
"s1": ("r1", "r2"),
"s2": ("r2", "r3"),
}
tgen = Topogen(topodef, mod.__name__)
tgen.start_topology()

router_list = tgen.routers()
Expand Down
50 changes: 8 additions & 42 deletions tests/topotests/bfd_isis_topo1/test_bfd_isis_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,52 +87,18 @@
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.isisd]


class TemplateTopo(Topo):
"Test topology builder"

def build(self, *_args, **_opts):
"Build function"
tgen = get_topogen(self)

#
# Define FRR Routers
#
for router in ["rt1", "rt2", "rt3", "rt4", "rt5"]:
tgen.add_router(router)

#
# Define connections
#
switch = tgen.add_switch("s1")
switch.add_link(tgen.gears["rt1"], nodeif="eth-rt2")
switch.add_link(tgen.gears["rt2"], nodeif="eth-rt1")

switch = tgen.add_switch("s2")
switch.add_link(tgen.gears["rt1"], nodeif="eth-rt3")
switch.add_link(tgen.gears["rt3"], nodeif="eth-rt1")

switch = tgen.add_switch("s3")
switch.add_link(tgen.gears["rt2"], nodeif="eth-rt5")
switch.add_link(tgen.gears["rt5"], nodeif="eth-rt2")

switch = tgen.add_switch("s4")
switch.add_link(tgen.gears["rt3"], nodeif="eth-rt4")
switch.add_link(tgen.gears["rt4"], nodeif="eth-rt3")

switch = tgen.add_switch("s5")
switch.add_link(tgen.gears["rt4"], nodeif="eth-rt5")
switch.add_link(tgen.gears["rt5"], nodeif="eth-rt4")


def setup_module(mod):
"Sets up the pytest environment"
tgen = Topogen(TemplateTopo, mod.__name__)
topodef = {
"s1": ("rt1:eth-rt2", "rt2:eth-rt1"),
"s2": ("rt1:eth-rt3", "rt3:eth-rt1"),
"s3": ("rt2:eth-rt5", "rt5:eth-rt2"),
"s4": ("rt3:eth-rt4", "rt4:eth-rt3"),
"s5": ("rt4:eth-rt5", "rt5:eth-rt4"),
}
tgen = Topogen(topodef, mod.__name__)
tgen.start_topology()

router_list = tgen.routers()
Expand Down
52 changes: 10 additions & 42 deletions tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,61 +84,29 @@
# 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.ospfd]


class TemplateTopo(Topo):
"Test topology builder"

def build(self, *_args, **_opts):
"Build function"
tgen = get_topogen(self)

#
# Define FRR Routers
#
for router in ["rt1", "rt2", "rt3", "rt4", "rt5"]:
tgen.add_router(router)

#
# Define connections
#
switch = tgen.add_switch("s1")
switch.add_link(tgen.gears["rt1"], nodeif="eth-rt2")
switch.add_link(tgen.gears["rt2"], nodeif="eth-rt1")

switch = tgen.add_switch("s2")
switch.add_link(tgen.gears["rt1"], nodeif="eth-rt3")
switch.add_link(tgen.gears["rt3"], nodeif="eth-rt1")

switch = tgen.add_switch("s3")
switch.add_link(tgen.gears["rt2"], nodeif="eth-rt5")
switch.add_link(tgen.gears["rt5"], nodeif="eth-rt2")

switch = tgen.add_switch("s4")
switch.add_link(tgen.gears["rt3"], nodeif="eth-rt4")
switch.add_link(tgen.gears["rt4"], nodeif="eth-rt3")

switch = tgen.add_switch("s5")
switch.add_link(tgen.gears["rt4"], nodeif="eth-rt5")
switch.add_link(tgen.gears["rt5"], nodeif="eth-rt4")


def setup_module(mod):
"Sets up the pytest environment"
tgen = Topogen(TemplateTopo, mod.__name__)
topodef = {
"s1": ("rt1:eth-rt2", "rt2:eth-rt1"),
"s2": ("rt1:eth-rt3", "rt3:eth-rt1"),
"s3": ("rt2:eth-rt5", "rt5:eth-rt2"),
"s4": ("rt3:eth-rt4", "rt4:eth-rt3"),
"s5": ("rt4:eth-rt5", "rt5:eth-rt4"),
}
tgen = Topogen(topodef, mod.__name__)
tgen.start_topology()

router_list = tgen.routers()

# For all registered routers, load the zebra configuration file
for rname, router in router_list.iteritems():
for rname, router in router_list.items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
Expand Down
46 changes: 9 additions & 37 deletions tests/topotests/bfd_profiles_topo1/test_bfd_profiles_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,19 @@
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, pytest.mark.isisd, pytest.mark.ospfd]


class BFDProfTopo(Topo):
"Test topology builder"

def build(self, *_args, **_opts):
"Build function"
tgen = get_topogen(self)

# Create 6 routers
for routern in range(1, 7):
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"])

switch = tgen.add_switch("s4")
switch.add_link(tgen.gears["r4"])
switch.add_link(tgen.gears["r5"])

switch = tgen.add_switch("s5")
switch.add_link(tgen.gears["r1"])
switch.add_link(tgen.gears["r6"])


def setup_module(mod):
"Sets up the pytest environment"
tgen = Topogen(BFDProfTopo, mod.__name__)

topodef = {
"s1": ("r1", "r2"),
"s2": ("r2", "r3"),
"s3": ("r3", "r4"),
"s4": ("r4", "r5"),
"s5": ("r1", "r6"),
}
tgen = Topogen(topodef, mod.__name__)
tgen.start_topology()

router_list = tgen.routers()
Expand Down
34 changes: 6 additions & 28 deletions tests/topotests/bfd_topo1/test_bfd_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,17 @@
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["r2"])
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": ("r2", "r4"),
}
tgen = Topogen(topodef, mod.__name__)
tgen.start_topology()

router_list = tgen.routers()
Expand Down
Loading