]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib/ltemplate.py: add KeepGoing parameter to ltemplateTest
authorG. Paul Ziemba <paulz@labn.net>
Sat, 3 Mar 2018 20:22:39 +0000 (12:22 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:13 +0000 (20:22 -0500)
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
tests/topotests/lib/ltemplate.py

index 9c511f7bc7d7bc9bf393d58312ff315104267ad0..5843b4096a59bae152bc6062470a1052818cd04d 100644 (file)
@@ -144,7 +144,7 @@ def teardown_module(mod):
     tgen.stop_topology()
     _lt = None
 
-def ltemplateTest(script, SkipIfFailed=True, CallOnFail=None, CheckFuncStr=None):
+def ltemplateTest(script, SkipIfFailed=True, CallOnFail=None, CheckFuncStr=None, KeepGoing=False):
     tgen = get_topogen()
     if not os.path.isfile(script):
         if not os.path.isfile(os.path.join(_lt.scriptdir, script)):
@@ -156,7 +156,8 @@ def ltemplateTest(script, SkipIfFailed=True, CallOnFail=None, CheckFuncStr=None)
     if SkipIfFailed and tgen.routers_have_failure():
         pytest.skip(tgen.errors)
     if numEntry > 0:
-        pytest.skip("Have %d errors" % numEntry)
+       if not KeepGoing:
+           pytest.skip("Have %d errors" % numEntry)
 
     if CheckFuncStr != None:
         check = eval(CheckFuncStr)
@@ -170,7 +171,8 @@ def ltemplateTest(script, SkipIfFailed=True, CallOnFail=None, CheckFuncStr=None)
     if numFail > 0:
         luShowFail()
         fatal_error = "%d tests failed" % numFail
-        assert "scripts/cleanup_all.py failed" == "See summary output above", fatal_error
+       if not KeepGoing:
+           assert "scripts/cleanup_all.py failed" == "See summary output above", fatal_error
 
 # Memory leak test template
 def test_memory_leak():