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:48:04 +0100
commit6b9e3d83030a6fe63d29bf679db93e4793700ee2 (patch)
tree2646c533bbff55f37f3ae34f0a3af730ef7f4d67
parente03d0444b53d1a9eaeadf52f66fb69d35889d768 (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>
-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):