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
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)
)
# 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)
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(
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(
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"')
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"])