aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci/run_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest/ci/run_tests.py')
-rwxr-xr-xfunctest/ci/run_tests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py
index 0d1b17da..0e951eff 100755
--- a/functest/ci/run_tests.py
+++ b/functest/ci/run_tests.py
@@ -136,7 +136,7 @@ def run_test(test, tier_name, testcases=None):
logger.debug("\n%s" % test)
source_rc_file()
- if GlobalVariables.CLEAN_FLAG:
+ if test.needs_clean() and GlobalVariables.CLEAN_FLAG:
generate_os_snapshot()
flags = (" -t %s" % (test_name))
@@ -150,6 +150,7 @@ def run_test(test, tier_name, testcases=None):
module = importlib.import_module(run_dict['module'])
cls = getattr(module, run_dict['class'])
test_case = cls()
+
try:
kwargs = run_dict['args']
result = test_case.run(**kwargs)
@@ -168,8 +169,9 @@ def run_test(test, tier_name, testcases=None):
else:
raise Exception("Cannot import the class for the test case.")
- if GlobalVariables.CLEAN_FLAG:
+ if test.needs_clean() and GlobalVariables.CLEAN_FLAG:
cleanup()
+
end = datetime.datetime.now()
duration = (end - start).seconds
duration_str = ("%02d:%02d" % divmod(duration, 60))