summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--functest/core/pytest_suite_runner.py8
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_base.py4
-rw-r--r--functest/tests/unit/utils/test_functest_utils.py4
-rw-r--r--functest/utils/functest_utils.py4
4 files changed, 11 insertions, 9 deletions
diff --git a/functest/core/pytest_suite_runner.py b/functest/core/pytest_suite_runner.py
index 5cbb3621b..bcbaa25d3 100644
--- a/functest/core/pytest_suite_runner.py
+++ b/functest/core/pytest_suite_runner.py
@@ -52,13 +52,13 @@ class PyTestSuiteRunner(testcase.TestCase):
# TestCase.EX_RUN_ERROR means that the test case was not run
# not that it was run but the result was FAIL
exit_code = testcase.TestCase.EX_OK
- if ((result.errors and len(result.errors) > 0)
- or (result.failures and len(result.failures) > 0)):
+ if ((result.errors and len(result.errors) > 0) or
+ (result.failures and len(result.failures) > 0)):
self.logger.info("%s FAILED", self.case_name)
- self.result = 'FAIL'
+ self.result = 0
else:
self.logger.info("%s OK", self.case_name)
- self.result = 'PASS'
+ self.result = 100
self.details = {}
return exit_code
diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py
index 8eb41beef..8e71bf82c 100644
--- a/functest/opnfv_tests/openstack/vping/vping_base.py
+++ b/functest/opnfv_tests/openstack/vping/vping_base.py
@@ -31,6 +31,7 @@ class VPingBase(TestCase):
internal network.
This class is responsible for creating the image, internal network.
"""
+
def __init__(self, **kwargs):
super(VPingBase, self).__init__(**kwargs)
@@ -155,7 +156,7 @@ class VPingBase(TestCase):
return TestCase.EX_RUN_ERROR
self.stop_time = time.time()
- self.result = 'PASS'
+ self.result = 100
return TestCase.EX_OK
def _cleanup(self):
@@ -193,6 +194,7 @@ class VPingBase(TestCase):
class VPingMain(object):
+
def __init__(self, vping_cls):
self.vping = vping_cls()
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py
index 6714e55f7..d48e06f92 100644
--- a/functest/tests/unit/utils/test_functest_utils.py
+++ b/functest/tests/unit/utils/test_functest_utils.py
@@ -569,7 +569,7 @@ class FunctestUtilsTesting(unittest.TestCase):
mock_criteria.return_value = self.criteria
resp = functest_utils.check_success_rate(self.case_name,
self.result)
- self.assertEqual(resp, 'PASS')
+ self.assertEqual(resp, 100)
def test_check_success_rate_failed(self):
with mock.patch('functest.utils.functest_utils.get_criteria_by_test') \
@@ -577,7 +577,7 @@ class FunctestUtilsTesting(unittest.TestCase):
mock_criteria.return_value = self.criteria
resp = functest_utils.check_success_rate(self.case_name,
0)
- self.assertEqual(resp, 'FAIL')
+ self.assertEqual(resp, 0)
# TODO: merge_dicts
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py
index 6be3883fa..744258b36 100644
--- a/functest/utils/functest_utils.py
+++ b/functest/utils/functest_utils.py
@@ -385,8 +385,8 @@ def check_success_rate(case_name, result):
logger.warning('check_success_rate will be removed soon')
criteria = get_criteria_by_test(case_name)
if type(criteria) == int and result >= criteria:
- return 'PASS'
- return 'FAIL'
+ return 100
+ return 0
def merge_dicts(dict1, dict2):