aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-06-15 16:42:57 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-15 16:42:57 +0000
commitb3a638c4d493b700a263feb716402c1a2e3c10ba (patch)
tree7f1f5c1c4c7f4a5856bf0300e05f6c2c338f36a1
parent7d340cededc905eb4e3174bd68fcf9ad9be73b41 (diff)
parent10c1f99f8d16196e2898c11f9b5c1d3f0735807a (diff)
Merge "Try/except ODL push to DB until ODL tests are refactored"
-rw-r--r--testcases/Controllers/ODL/odlreport2db.py43
1 files changed, 20 insertions, 23 deletions
diff --git a/testcases/Controllers/ODL/odlreport2db.py b/testcases/Controllers/ODL/odlreport2db.py
index 3eff4006..075de5a8 100644
--- a/testcases/Controllers/ODL/odlreport2db.py
+++ b/testcases/Controllers/ODL/odlreport2db.py
@@ -110,17 +110,17 @@ def main(argv):
# dictionary populated with data from xml file
all_data = xmltodict.parse(xml_input)['robot']
- data = parse_suites(all_data['suite']['suite'])
- data['description'] = all_data['suite']['@name']
- data['version'] = all_data['@generator']
- data['test_project'] = "functest"
- data['case_name'] = "ODL"
- data['pod_name'] = pod
- data['installer'] = installer
+ try:
+ data = parse_suites(all_data['suite']['suite'])
+ data['description'] = all_data['suite']['@name']
+ data['version'] = all_data['@generator']
+ data['test_project'] = "functest"
+ data['case_name'] = "ODL"
+ data['pod_name'] = pod
+ data['installer'] = installer
- json.dumps(data, indent=4, separators=(',', ': '))
+ json.dumps(data, indent=4, separators=(',', ': '))
- try:
# example:
# python odlreport2db.py -x ~/Pictures/Perso/odl/output3.xml
# -i fuel
@@ -133,19 +133,16 @@ def main(argv):
# start and stoptime have no real meaning
start_time = time.time()
stop_time = start_time
- 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 = "PASS"
- except:
- print("Unable to set criteria" % sys.exc_info()[0])
+ 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 = "PASS"
functest_utils.push_results_to_db("functest",
data['case_name'],
@@ -156,7 +153,7 @@ def main(argv):
data)
except:
- print("Error pushing results into Database '%s'" % sys.exc_info()[0])
+ print("Error pushing ODL results into DB '%s'" % sys.exc_info()[0])
if __name__ == "__main__":