]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgp_direct_to_bgp_vpn: general cleanup use moved lutil.py improve error information...
authorLou Berger <lberger@labn.net>
Tue, 5 Dec 2017 17:04:54 +0000 (12:04 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:12 +0000 (20:22 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
tests/topotests/bgp_direct_to_bgp_vpn/scripts/add_routes.py
tests/topotests/bgp_direct_to_bgp_vpn/scripts/adjacencies.py
tests/topotests/bgp_direct_to_bgp_vpn/scripts/check_routes.py
tests/topotests/bgp_direct_to_bgp_vpn/test_bgp_direct_to_bgp_vpn.py

index ac25d0b8fc28201b5c949fe29080349e04c68147..03e1a16765cf3620aed0a09f248950edbbc2ae49 100644 (file)
@@ -5,9 +5,9 @@ luCommand('r4','vtysh -c "add vrf cust1 prefix 99.0.0.3/32"','.','none','IP Addr
 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')
index 049c1b430db355b3a881cde79e46a3663d7d7ec0..2645d28f309e154f2844d511595a30fd802127ef 100644 (file)
@@ -1,5 +1,5 @@
 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')
index e4a9044393e8ebd613365405b5b02f8712289bf9..0b6f7ff49b3b17790ebc517660eef898cdcd20bb 100644 (file)
@@ -1,13 +1,13 @@
 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')
 
index 9101c28dbcfd6482c9f472a32e1d927c2d1a7bc6..90d7f9ede3de4d32bc2cc0f67b93b68b96ce3e92 100755 (executable)
@@ -1,7 +1,6 @@
 #!/usr/bin/env python
 
 #
-# <template>.py
 # Part of NetDEF Topology Tests
 #
 # Copyright (c) 2017 by
@@ -81,19 +80,18 @@ import pytest
 # 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"
@@ -133,7 +131,7 @@ class TemplateTopo(Topo):
 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()
 
@@ -158,6 +156,10 @@ def setup_module(mod):
     # 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()
@@ -165,16 +167,6 @@ def teardown_module(mod):
     # 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()
 
@@ -197,23 +189,29 @@ def test_run_lu_tests():
         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():