diff options
Diffstat (limited to 'testcases/OpenStack/tempest/run_tempest.py')
-rwxr-xr-x | testcases/OpenStack/tempest/run_tempest.py | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/testcases/OpenStack/tempest/run_tempest.py b/testcases/OpenStack/tempest/run_tempest.py index 8d23b741..ca9e928a 100755 --- a/testcases/OpenStack/tempest/run_tempest.py +++ b/testcases/OpenStack/tempest/run_tempest.py @@ -21,11 +21,11 @@ import shutil import subprocess import sys import time -import yaml import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import functest.utils.openstack_utils as os_utils +import yaml modes = ['full', 'smoke', 'baremetal', 'compute', 'data_processing', @@ -341,7 +341,7 @@ def apply_tempest_blacklist(): black_list_yaml = yaml.safe_load(black_list_file) black_list_file.close() for item in black_list_yaml: - scenarios = item['sceanrios'] + scenarios = item['scenarios'] installers = item['installers'] if (deploy_scenario in scenarios and installer_type in installers): @@ -427,34 +427,20 @@ def run_tempest(OPTION): dur_sec_int = dur_sec_int + 60 * dur_min stop_time = time.time() - status = "FAIL" try: diff = (int(num_tests) - int(num_failures)) success_rate = 100 * diff / int(num_tests) except: success_rate = 0 - # For Tempest we assume that the success rate is above 90% - if "smoke" in args.mode: - case_name = "tempest_smoke_serial" - # Note criteria hardcoded...TODO read it from testcases.yaml - success_criteria = 100 - if success_rate >= success_criteria: - status = "PASS" - else: - logger.info("Tempest success rate: %s%%. The success criteria to " - "pass this test is %s%%. Marking the test as FAILED." % - (success_rate, success_criteria)) + if 'smoke' in args.mode: + case_name = 'tempest_smoke_serial' else: - case_name = "tempest_full_parallel" - # Note criteria hardcoded...TODO read it from testcases.yaml - success_criteria = 80 - if success_rate >= success_criteria: - status = "PASS" - else: - logger.info("Tempest success rate: %s%%. The success criteria to " - "pass this test is %s%%. Marking the test as FAILED." % - (success_rate, success_criteria)) + case_name = 'tempest_full_parallel' + + status = ft_utils.check_success_rate(case_name, success_rate) + logger.info("Tempest %s success_rate is %s%%, is marked as %s" + % (case_name, success_rate, status)) # Push results in payload of testcase if args.report: |