From 03fc68820d1badd600832de3b7c6dd72368dd198 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Wed, 8 Jun 2016 15:56:54 +0200 Subject: Adapt functest testcase to APi refactoring JIRA: FUNCTEST-303 Change-Id: Ia276d9ca6e8d62b496c3b5f81561b14b02c43fd7 Signed-off-by: Morgan Richomme --- testcases/features/doctor.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'testcases/features/doctor.py') diff --git a/testcases/features/doctor.py b/testcases/features/doctor.py index ac68430a..c7fc848c 100644 --- a/testcases/features/doctor.py +++ b/testcases/features/doctor.py @@ -34,12 +34,12 @@ logger = ft_logger.Logger("doctor").getLogger() def main(): cmd = 'cd %s/tests && ./run.sh' % DOCTOR_REPO - start_time_ts = time.time() + start_time = time.time() ret = functest_utils.execute_command(cmd, logger, exit_on_error=False) - end_time_ts = time.time() - duration = round(end_time_ts - start_time_ts, 1) + stop_time = time.time() + duration = round(end_time_ts - start_time, 1) if ret: logger.info("doctor OK") test_status = 'OK' @@ -48,7 +48,7 @@ def main(): test_status = 'NOK' details = { - 'timestart': start_time_ts, + 'timestart': start_time, 'duration': duration, 'status': test_status, } @@ -61,7 +61,7 @@ def main(): if details['status'] == "OK": status = "passed" - logger.info("Pushing result: TEST_DB_URL=%(db)s pod_name=%(pod)s " + logger.info("Pushing Doctor results: TEST_DB_URL=%(db)s pod_name=%(pod)s " "version=%(v)s scenario=%(s)s criteria=%(c)s details=%(d)s" % { 'db': TEST_DB_URL, 'pod': pod_name, @@ -71,11 +71,13 @@ def main(): 'b': build_tag, 'd': details, }) - functest_utils.push_results_to_db(TEST_DB_URL, - 'doctor', 'doctor-notification', - logger, pod_name, version, scenario, - status, build_tag, details) - + functest_utils.push_results_to_db("doctor", + "doctor-notification", + logger, + start_time, + stop_time, + status, + details) if __name__ == '__main__': main() -- cgit 1.2.3-korg