luCommand('r1','vtysh -c "show vnc registrations local"','99.0.0.1','pass','Local Registration')
luCommand('r3','vtysh -c "show vnc registrations local"','99.0.0.2','pass','Local Registration')
luCommand('r4','vtysh -c "show vnc registrations local"','99.0.0.3','pass','Local Registration')
-luCommand('r1','vtysh -c "show vnc registrations remote"','4 out of 4','wait','Remote Registration')
+luCommand('r1','vtysh -c "show vnc registrations remote"','6 out of 6','wait','Remote Registration')
luCommand('r3','vtysh -c "show vnc registrations remote"','6 out of 6','wait','Remote Registration')
-luCommand('r4','vtysh -c "show vnc registrations remote"','4 out of 4','wait','Remote Registration')
+luCommand('r4','vtysh -c "show vnc registrations remote"','6 out of 6','wait','Remote Registration')
luCommand('r1','vtysh -c "show vnc registrations"','.','none')
luCommand('r3','vtysh -c "show vnc registrations"','.','none')
luCommand('r4','vtysh -c "show vnc registrations"','.','none')
from lutil import luCommand
-luCommand('r1','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up')
+luCommand('r1','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up', 60)
luCommand('r2','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up')
luCommand('r3','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up')
luCommand('r4','vtysh -c "show bgp summary"',' 00:0.* 00:0','wait','Adjacencies up')
from lutil import luCommand
luCommand('ce1','vtysh -c "show bgp ipv4 uni"','7 routes and 7','wait','Local and remote routes')
-luCommand('ce2','vtysh -c "show bgp ipv4 uni"','7 routes and 9','wait','Local and remote routes')
+luCommand('ce2','vtysh -c "show bgp ipv4 uni"','7 routes and 7','wait','Local and remote routes')
luCommand('ce3','vtysh -c "show bgp ipv4 uni"','7 routes and 7','wait','Local and remote routes')
luCommand('r1','vtysh -c "show bgp ipv4 uni"','7 routes and 9','pass','Unicast SAFI')
luCommand('r2','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Unicast SAFI')
luCommand('r3','vtysh -c "show bgp ipv4 uni"','7 routes and 9','pass','Unicast SAFI')
luCommand('r4','vtysh -c "show bgp ipv4 uni"','7 routes and 9','pass','Unicast SAFI')
-luCommand('r1','vtysh -c "show bgp ipv4 vpn"','7 routes and 7','pass','VPN SAFI')
-luCommand('r2','vtysh -c "show bgp ipv4 vpn"','7 routes and 7','pass','VPN SAFI')
-luCommand('r3','vtysh -c "show bgp ipv4 vpn"','7 routes and 7','pass','VPN SAFI')
-luCommand('r4','vtysh -c "show bgp ipv4 vpn"','7 routes and 7','pass','VPN SAFI')
+luCommand('r1','vtysh -c "show bgp ipv4 vpn"','9 routes and 9','pass','VPN SAFI')
+luCommand('r2','vtysh -c "show bgp ipv4 vpn"','9 routes and 9','pass','VPN SAFI')
+luCommand('r3','vtysh -c "show bgp ipv4 vpn"','9 routes and 9','pass','VPN SAFI')
+luCommand('r4','vtysh -c "show bgp ipv4 vpn"','9 routes and 9','pass','VPN SAFI')
#!/usr/bin/env python
#
-# <template>.py
# Part of NetDEF Topology Tests
#
# Copyright (c) 2017 by
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(CWD, '../'))
-sys.path.append(os.path.join(CWD, '../utilities'))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
-from lutil import luStart, luInclude, luFinish, luNumFail
+from lib.lutil import luStart, luInclude, luFinish, luNumFail, luShowFail
# Required to instantiate the topology builder class.
from mininet.topo import Topo
-class TemplateTopo(Topo):
+class ThisTestTopo(Topo):
"Test topology builder"
def build(self, *_args, **_opts):
"Build function"
def setup_module(mod):
"Sets up the pytest environment"
# This function initiates the topology build with Topogen...
- tgen = Topogen(TemplateTopo, mod.__name__)
+ tgen = Topogen(ThisTestTopo, mod.__name__)
# ... and here it calls Mininet initialization functions.
tgen.start_topology()
# After loading the configurations, this function loads configured daemons.
tgen.start_router()
+ # For debugging after starting daemons, uncomment the next line
+ #tgen.mininet_cli()
+
+
def teardown_module(mod):
"Teardown the pytest environment"
tgen = get_topogen()
# This function tears down the whole topology.
tgen.stop_topology()
-def no_test_call_mininet_cli():
- "Dummy test that just calls mininet CLI so we can interact with the build."
- tgen = get_topogen()
- # Don't run this test if we have any failure.
- if tgen.routers_have_failure():
- pytest.skip(tgen.errors)
-
- logger.info('calling mininet CLI')
- tgen.mininet_cli()
-
def test_run_lu_tests():
tgen = get_topogen()
print("\n\n** Running main test cases")
print("******************************\n")
- luStart(os.path.dirname(os.path.realpath(__file__)), tgen.net)
+ luStart(os.path.dirname(os.path.realpath(__file__)),
+ router.logdir, tgen.net)
- luInclude('teststart.py')
- # For debugging after starting FRR/Quagga daemons, uncomment the next line
- #CLI(net)
+ CliOnFail = False
+ # For debugging, uncomment the next line
+ #CliOnFail = tgen.mininet_cli
+
+ luInclude('teststart.py', CliOnFail)
+ # For debugging, uncomment the next line
+ #tgen.mininet_cli()
- luInclude('testfinish.py')
+ luInclude('testfinish.py', CliOnFail)
print(luFinish())
# For debugging after starting FRR/Quagga daemons, uncomment the next line
- #CLI(net)
+ #tgen.mininet_cli()
# Make sure that all daemons are running
numFail = luNumFail()
if numFail > 0:
+ luShowFail()
fatal_error = '%d tests failed' % numFail
- assert fatal_error == "", fatal_error
+ assert fatal_error == 'See summary output above', fatal_error
# Memory leak test template
def test_memory_leak():