fix ha testcase PASS/FAIL judgement 37/34337/4
authorMatthewLi <matthew.lijun@huawei.com>
Fri, 5 May 2017 07:46:12 +0000 (03:46 -0400)
committerMatthewLi <matthew.lijun@huawei.com>
Mon, 8 May 2017 10:15:18 +0000 (06:15 -0400)
JIRA: DOVETAIL-425

Change-Id: Ifee2473956e0a1a3ad9c98beff92d94327251614
Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
dovetail/report.py

index 2c6200d..0d83831 100644 (file)
@@ -322,7 +322,12 @@ class YardstickCrawler(object):
             for jsonfile in f:
                 data = json.loads(jsonfile)
                 if 1 == data['status']:
-                    criteria = 'PASS'
+                    try:
+                        v = data['result'][1]['benchmark']['data']['sla_pass']
+                        if 1 == v:
+                            criteria = 'PASS'
+                    except KeyError as e:
+                        self.logger.error('pass flag not found %s', e)
         json_results = {'criteria': criteria}
         self.logger.debug('Results: %s', str(json_results))
         return json_results