diff options
author | 2017-05-09 12:06:57 +0200 | |
---|---|---|
committer | 2017-05-09 13:42:21 +0200 | |
commit | f2bbfb690ce435c389b548d6b299ff82f658ea80 (patch) | |
tree | 19af76c5262ca9fc6fb2eadd858b90be3b879b36 /functest/opnfv_tests/sdn | |
parent | 1d5e199517ff09d959a1240f3b4e715be799058b (diff) |
Conform ODL with last framework updates
Now ODL TestCase calculates the ratio between critical tests passed
and failed and saves it in result. Non-critical test cases can fail as
result doesn't take them into account [1].
It also updates default attribute values in TestCase and allows result
to be float.
[1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#setting-criticality
Change-Id: Id4a89271b5b1a90cd3c1e2b08591ff26ffaffee0
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/sdn')
-rwxr-xr-x | functest/opnfv_tests/sdn/odl/odl.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py index f92cb95d..e50d9c13 100755 --- a/functest/opnfv_tests/sdn/odl/odl.py +++ b/functest/opnfv_tests/sdn/odl/odl.py @@ -16,6 +16,8 @@ Example: $ python odl.py """ +from __future__ import division + import argparse import errno import fileinput @@ -100,7 +102,12 @@ class ODLTests(testcase.TestCase): result = robot.api.ExecutionResult(xml_file) visitor = ODLResultVisitor() result.visit(visitor) - self.result = result.suite.status + try: + self.result = 100 * ( + result.suite.statistics.critical.passed / + result.suite.statistics.critical.total) + except ZeroDivisionError: + self.__logger.error("No test has been ran") self.start_time = timestamp_to_secs(result.suite.starttime) self.stop_time = timestamp_to_secs(result.suite.endtime) self.details = {} |