diff options
author | 2015-10-28 10:07:04 +0100 | |
---|---|---|
committer | 2015-10-28 12:03:54 +0100 | |
commit | 11d8d4904b5346c8ca904e4a3723ddf5ba5bad8c (patch) | |
tree | 8665bf70446b5d94b3b8a8bf606beabb71e42570 /testcases/functest_utils.py | |
parent | 6c22017400294fa017a28de00e6cc756db2d450f (diff) |
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 <valentin.boucher@orange.com>
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r-- | testcases/functest_utils.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py index 59e89a5a..262149b2 100644 --- a/testcases/functest_utils.py +++ b/testcases/functest_utils.py @@ -13,6 +13,8 @@ import os import urllib2 import subprocess import sys +import requests +import json from git import Repo @@ -434,3 +436,19 @@ def get_installer_type(logger=None): installer = "Unkown" return installer + +def push_results_to_db(db_url, case_name, logger, pod_name, git_version, payload): + url = db_url + "/results" + installer = get_installer_type(logger) + params = {"project_name": "functest", "case_name": case_name, + "pod_name": pod_name, "installer": installer, + "version": git_version, "details": payload} + + headers = {'Content-Type': 'application/json'} + try: + r = requests.post(url, data=json.dumps(params), headers=headers) + logger.debug(r) + return True + except: + print "Error:", sys.exc_info()[0] + return False |