diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-06-08 15:56:54 +0200 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2016-06-08 16:43:47 +0200 |
commit | 03fc68820d1badd600832de3b7c6dd72368dd198 (patch) | |
tree | 0ece513a5ea3acd1296e299fd1e09a331f80ad03 /testcases/vIMS | |
parent | 4c971bff1c2e4665bbf389f84acfa4d2c81f9b55 (diff) |
Adapt functest testcase to APi refactoring
JIRA: FUNCTEST-303
Change-Id: Ia276d9ca6e8d62b496c3b5f81561b14b02c43fd7
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'testcases/vIMS')
-rw-r--r-- | testcases/vIMS/vIMS.py | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/testcases/vIMS/vIMS.py b/testcases/vIMS/vIMS.py index 2430af1a..3cdbab9b 100644 --- a/testcases/vIMS/vIMS.py +++ b/testcases/vIMS/vIMS.py @@ -115,33 +115,22 @@ def download_and_add_image_on_glance(glance, image_name, image_url): def step_failure(step_name, error_msg): logger.error(error_msg) set_result(step_name, 0, error_msg) - status = "failed" + status = "FAIL" + # in case of failure starting and stoping time are not correct + start_time = time.time() + stop_time = start_time if step_name == "sig_test": - status = "passed" - push_results(status) + status = "PASS" + functest_utils.push_results_to_db("functest", + "vIMS", + logger, + start_time, + stop_time, + status, + RESULTS) exit(-1) -def push_results(status): - if args.report: - logger.debug("Pushing results to DB....") - - scenario = functest_utils.get_scenario(logger) - version = functest_utils.get_version(logger) - pod_name = functest_utils.get_pod_name(logger) - build_tag = functest_utils.get_build_tag(logger) - - functest_utils.push_results_to_db(db_url=DB_URL, - project="functest", - case_name="vIMS", - logger=logger, pod_name=pod_name, - version=version, - scenario=scenario, - criteria=status, - build_tag=build_tag, - payload=RESULTS) - - def set_result(step_name, duration=0, result=""): RESULTS[step_name] = {'duration': duration, 'result': result} @@ -245,14 +234,22 @@ def test_clearwater(): # success criteria for vIMS (for Brahmaputra) # - orchestrator deployed # - VNF deployed - status = "failed" + # TODO use test criteria defined in config file + status = "FAIL" try: if (RESULTS['orchestrator']['duration'] > 0 and RESULTS['vIMS']['duration'] > 0): - status = "passed" + status = "PASS" except: logger.error("Unable to set test status") - push_results(status) + + functest_utils.push_results_to_db("functest", + "vIMS", + logger, + start_time_ts, + end_time_ts, + status, + RESULTS) try: os.remove(VIMS_TEST_DIR + "temp.json") |