aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/OpenStack
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-08-02 13:48:51 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-08-02 14:53:00 +0800
commit0abfe03d2246200f47b171bfc9b8e4c567eb22b2 (patch)
tree8cb60c491d5d59b3eaa8a21ce90683f8e19b6e99 /testcases/OpenStack
parent8f3ad08c40bd8977651794f6720eda5df61b0c26 (diff)
use configured success_rate to check tempest test status
when checking tempest test results using success_rate configured in testcases.yaml rather than written it in the code JIRA: FUNCTEST-400 Change-Id: I2a34e3e032a0d94c6a4605fcf09a66c8f8f9b78c Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testcases/OpenStack')
-rwxr-xr-xtestcases/OpenStack/tempest/run_tempest.py28
1 files changed, 7 insertions, 21 deletions
diff --git a/testcases/OpenStack/tempest/run_tempest.py b/testcases/OpenStack/tempest/run_tempest.py
index 3ee10b78..ca9e928a 100755
--- a/testcases/OpenStack/tempest/run_tempest.py
+++ b/testcases/OpenStack/tempest/run_tempest.py
@@ -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: