aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/features/promise.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-06-08 15:56:54 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2016-06-08 16:43:47 +0200
commit03fc68820d1badd600832de3b7c6dd72368dd198 (patch)
tree0ece513a5ea3acd1296e299fd1e09a331f80ad03 /testcases/features/promise.py
parent4c971bff1c2e4665bbf389f84acfa4d2c81f9b55 (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/features/promise.py')
-rw-r--r--testcases/features/promise.py37
1 files changed, 14 insertions, 23 deletions
diff --git a/testcases/features/promise.py b/testcases/features/promise.py
index c74c7cfa..7f034643 100644
--- a/testcases/features/promise.py
+++ b/testcases/features/promise.py
@@ -12,8 +12,8 @@
import argparse
import json
import os
-import requests
import subprocess
+import time
import yaml
import keystoneclient.v2_0.client as ksclient
@@ -71,6 +71,7 @@ logger = ft_logger.Logger("promise").getLogger()
def main():
+ start_time = time.time()
ks_creds = openstack_utils.get_credentials("keystone")
nv_creds = openstack_utils.get_credentials("nova")
nt_creds = openstack_utils.get_credentials("neutron")
@@ -235,33 +236,23 @@ def main():
start_time, end_time, duration))
if args.report:
- pod_name = functest_utils.get_pod_name(logger)
- installer = functest_utils.get_installer_type(logger)
- scenario = functest_utils.get_scenario(logger)
- version = functest_utils.get_version(logger)
- build_tag = functest_utils.get_build_tag(logger)
- # git_version = functest_utils.get_git_branch(PROMISE_REPO)
- url = TEST_DB + "/results"
-
+ stop_time = time.time()
json_results = {"timestart": start_time, "duration": duration,
"tests": int(tests), "failures": int(failures)}
- logger.debug("Results json: " + str(json_results))
+ logger.debug("Promise Results json: " + str(json_results))
# criteria for Promise in Release B was 100% of tests OK
- status = "failed"
+ status = "FAIL"
if int(tests) > 32 and int(failures) < 1:
- status = "passed"
-
- params = {"project_name": "promise", "case_name": "promise",
- "pod_name": str(pod_name), 'installer': installer,
- "version": version, "scenario": scenario,
- "criteria": status, "build_tag": build_tag,
- 'details': json_results}
- headers = {'Content-Type': 'application/json'}
-
- logger.info("Pushing results to DB...")
- r = requests.post(url, data=json.dumps(params), headers=headers)
- logger.debug(r)
+ status = "PASS"
+
+ functest_utils.push_results_to_db("promise",
+ "promise",
+ logger,
+ start_time,
+ stop_time,
+ status,
+ json_results)
if __name__ == '__main__':