diff options
author | Romanos Skiadas <rski@intracom-telecom.com> | 2016-11-07 11:45:33 +0200 |
---|---|---|
committer | Romanos Skiadas <rski@intracom-telecom.com> | 2016-11-07 12:08:57 +0200 |
commit | 4db8c4108dcedae322ba6a3fde812e63f746d0f9 (patch) | |
tree | 7b836c092ae29b10ed59d44bf36d86569d92e1d5 /test/functest/results.py | |
parent | b9eb7024b014cba0d299b1cf3b01e179c7d0482e (diff) |
Refactor common code across tests
- Move collecting test results in a method in Results class
- Create a util function for asserting the environment has
enough compute nodes
Change-Id: Ib7b9dfab7d2e9f50d5f352d3eadba4d4717ee750
Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com>
Diffstat (limited to 'test/functest/results.py')
-rw-r--r-- | test/functest/results.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functest/results.py b/test/functest/results.py index baa6af7..7c73556 100644 --- a/test/functest/results.py +++ b/test/functest/results.py @@ -145,3 +145,22 @@ class Results(object): % vm_source.name) self.add_to_summary(2, "FAIL", test_case_name) break + + def compile_summary(self, SUCCESS_CRITERIA): + success_message = "All the subtests have passed." + failure_message = "One or more subtests have failed." + + self.add_to_summary(0, "=") + logger.info("\n%s" % self.summary) + if self.test_result == "PASS": + logger.info(success_message) + else: + logger.info(failure_message) + + status = "PASS" + success = 100 - \ + (100 * int(self.num_tests_failed) / int(self.num_tests)) + if success < int(SUCCESS_CRITERIA): + status = "FAILED" + + return {"status": status, "details": self.details} |