aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2019-12-02 23:43:55 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2019-12-02 23:49:56 +0100
commit344e93d2e181da54c8dea1e264851cd54349afff (patch)
tree32cbecf493c7dc162cd0e50f932488a300acedcf
parent323ce86ab2dc84fbe7e5bef1dcac8114c0441374 (diff)
Verify Shaker results via json report
As shaker always returns 0, it verifies the records and returns false after the first failure. Change-Id: I9393be0c65d315c1ca055de9f7f994f9db22eadb Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 6b9e3d83030a6fe63d29bf679db93e4793700ee2)
-rw-r--r--functest/opnfv_tests/openstack/shaker/shaker.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/functest/opnfv_tests/openstack/shaker/shaker.py b/functest/opnfv_tests/openstack/shaker/shaker.py
index 9d8a13274..fe52100e0 100644
--- a/functest/opnfv_tests/openstack/shaker/shaker.py
+++ b/functest/opnfv_tests/openstack/shaker/shaker.py
@@ -19,6 +19,7 @@ and list of tests to execute.
import logging
import os
+import json
import scp
from functest.core import singlevm
@@ -129,6 +130,13 @@ class Shaker(singlevm.SingleVm2):
except scp.SCPException:
self.__logger.exception("cannot get report files")
return 1
+ with open(os.path.join(self.res_dir, 'report.json')) as json_file:
+ data = json.load(json_file)
+ for value in data["records"].values():
+ if value["status"] != "ok":
+ self.__logger.error(
+ "%s failed\n%s", value["scenario"], value["stderr"])
+ return 1
return stdout.channel.recv_exit_status()
def clean(self):