From 11d8d4904b5346c8ca904e4a3723ddf5ba5bad8c Mon Sep 17 00:00:00 2001 From: boucherv Date: Wed, 28 Oct 2015 10:07:04 +0100 Subject: vIMS test integration and move "push_results_to_db" method Move "push_results_to_db" method to functest_util Updated some files for clearwater vIMS functional testing Change-Id: I21628b063470963e4e4425a0f89fefa33494e40d Signed-off-by: boucherv --- testcases/vPing/CI/libraries/vPing.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'testcases/vPing/CI') diff --git a/testcases/vPing/CI/libraries/vPing.py b/testcases/vPing/CI/libraries/vPing.py index b51bb6287..14671b66d 100644 --- a/testcases/vPing/CI/libraries/vPing.py +++ b/testcases/vPing/CI/libraries/vPing.py @@ -242,22 +242,6 @@ def cleanup(nova, neutron, network_dic): "Network '%s' deleted successfully" % NEUTRON_PRIVATE_NET_NAME) return True - -def push_results_to_db(payload): - - url = TEST_DB + "/results" - installer = functest_utils.get_installer_type(logger) - git_version = functest_utils.get_git_branch(args.repo_path) - # TODO pod_name hardcoded, info shall come from Jenkins - params = {"project_name": "functest", "case_name": "vPing", - "pod_name": "opnfv-jump-2", "installer": installer, - "version": git_version, "details": payload} - - headers = {'Content-Type': 'application/json'} - r = requests.post(url, data=json.dumps(params), headers=headers) - logger.debug(r) - - def main(): creds_nova = functest_utils.get_credentials("nova") @@ -437,8 +421,10 @@ def main(): if args.report: logger.debug("Push result into DB") # TODO check path result for the file - push_results_to_db( - {'timestart': start_time_ts, 'duration': duration, + git_version = functest_utils.get_git_branch(args.repo_path) + functest_utils.push_results_to_db(db_url=TEST_DB, case_name="vPing", + logger=logger, pod_name="opnfv-jump-2", git_version=git_version, + payload={'timestart': start_time_ts, 'duration': duration, 'status': test_status}) # with open("vPing-result.json", "w") as outfile: # json.dump({'timestart': start_time_ts, 'duration': duration, -- cgit 1.2.3-korg