diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-12-02 23:43:55 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-12-02 23:49:27 +0100 |
commit | c8f545c4bc2743e5d73ca882a92ab72aa067c6e9 (patch) | |
tree | b4fdfea9115c596c63d6a829794d846c2be32838 | |
parent | 798b8e7d9b86eb00261dac19e41f82faaa6c7d89 (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.py | 8 |
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): |