diff options
author | 2017-03-01 00:28:55 +0100 | |
---|---|---|
committer | 2017-03-01 00:44:48 +0100 | |
commit | 5560a30f425dc2b1fb2d8bb5b4f758326e9e591d (patch) | |
tree | b0f0bb4c484c3376100b86e643d319ea15ab28eb /functest/ci/run_tests.py | |
parent | 9815bea4fc18de05d0e9c5700ffe046ae1ad13fd (diff) |
Add clean_flag to test cases
Some test cases such as tempest or those using SNAPS
have a built-in cleaup or teardown mechanism.
This patch helps to save some time by bypassing the
openstack snapshot and cleanup when running those
kind of tests cases.
Change-Id: I50e7a17937a813532b3756474158416d3e85b922
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'functest/ci/run_tests.py')
-rwxr-xr-x | functest/ci/run_tests.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index f920e70d..2706a802 100755 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -143,7 +143,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)) @@ -157,6 +157,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) @@ -179,8 +180,9 @@ def run_test(test, tier_name, testcases=None): cmd, test_name)) result = ft_utils.execute_command(cmd) - 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)) |