From 7c9aef8db83e025034e3427c1330a00420fae50a Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Thu, 17 Mar 2016 18:09:12 +0100 Subject: Add criteria and version when pushing the results into test DB JIRA: FUNCTEST-151 Change-Id: Iac36f28db5f2203d7b2977a2bb973534fe167bac Signed-off-by: Morgan Richomme --- testcases/Controllers/ODL/CI/odlreport2db.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'testcases/Controllers/ODL/CI/odlreport2db.py') diff --git a/testcases/Controllers/ODL/CI/odlreport2db.py b/testcases/Controllers/ODL/CI/odlreport2db.py index 50731ffe1..3a696eb2d 100644 --- a/testcases/Controllers/ODL/CI/odlreport2db.py +++ b/testcases/Controllers/ODL/CI/odlreport2db.py @@ -130,12 +130,31 @@ def main(argv): # -i fuel # -p opnfv-jump-2 # -s os-odl_l2-ha + version = scenario + + # success criteria for ODL = 100% of tests OK + status = "failed" + try: + tests_passed = 0 + tests_failed = 0 + for v in data['details']: + if v['test_status']['@status'] == "PASS": + tests_passed += 1 + else: + tests_failed += 1 + + if (tests_failed < 1): + status = "passed" + except: + print("Unable to set criteria" % sys.exc_info()[0]) functest_utils.push_results_to_db(database, "functest", data['case_name'], None, data['pod_name'], + version, scenario, + status, build_tag, data) except: -- cgit 1.2.3-korg