From b54a55c4d963a6f80c24803481458b866138e697 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Tue, 20 Oct 2015 17:02:41 +0200 Subject: Change duration to integer seconds in tempest results JIRA: FUNCTEST-37 Change-Id: I4de4f8564598bbb8e47ff5e8062c696cf06ac55e Signed-off-by: jose.lausuch --- testcases/VIM/OpenStack/CI/libraries/run_tempest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'testcases') diff --git a/testcases/VIM/OpenStack/CI/libraries/run_tempest.py b/testcases/VIM/OpenStack/CI/libraries/run_tempest.py index 8a417ccfc..8ad62d15e 100644 --- a/testcases/VIM/OpenStack/CI/libraries/run_tempest.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_tempest.py @@ -120,9 +120,14 @@ def run_tempest(OPTION): num_failures = output[5] time_start = output[6] duration = output[7] + # Compute duration (lets assume it does not take more than 60 min) + dur_min=int(duration.split(':')[1]) + dur_sec_float=float(duration.split(':')[2]) + dur_sec_int=int(round(dur_sec_float,0)) + dur_sec_int = dur_sec_int + 60 * dur_min # Generate json results for DB - json_results = {"timestart": time_start, "duration": duration, + json_results = {"timestart": time_start, "duration": dur_sec_int, "tests": int(num_tests), "failures": int(num_failures)} logger.info("Results: "+str(json_results)) push_results_to_db(json_results, MODE, "opnfv-jump-2") -- cgit 1.2.3-korg