summaryrefslogtreecommitdiffstats
path: root/functest/core
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-03-27 09:33:20 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-03-27 10:27:02 +0200
commit407d27585f109e3381bb49041abc49a14b7b5bfe (patch)
tree8a4ca0b636a7c4b4a8bd2ba1f6bfa1a1292ac64e /functest/core
parent8d177dd1ac61078cb4134a1ff925ce25a777f5a0 (diff)
Switch TestcaseBase to TestCase
It partially reverts "Rename TestCasesBase into TestcaseBase" [1] and removes the useless suffix too. [1] https://gerrit.opnfv.org/gerrit/#/c/25391/ Change-Id: Iddf2ec8d6c1dafe6e4c6713c2e69969613317471 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/core')
-rw-r--r--functest/core/feature_base.py8
-rw-r--r--functest/core/pytest_suite_runner.py6
-rw-r--r--functest/core/testcase_base.py14
-rw-r--r--functest/core/vnf_base.py8
4 files changed, 18 insertions, 18 deletions
diff --git a/functest/core/feature_base.py b/functest/core/feature_base.py
index 2bd1ec83..9224d6c9 100644
--- a/functest/core/feature_base.py
+++ b/functest/core/feature_base.py
@@ -6,7 +6,7 @@ import functest.utils.functest_logger as ft_logger
from functest.utils.constants import CONST
-class FeatureBase(base.TestcaseBase):
+class FeatureBase(base.TestCase):
def __init__(self, project='functest', case='', repo='', cmd=''):
super(FeatureBase, self).__init__()
@@ -26,7 +26,7 @@ class FeatureBase(base.TestcaseBase):
self.parse_results(ret)
self.log_results()
self.logger.info("Test result is stored in '%s'" % self.result_file)
- return base.TestcaseBase.EX_OK
+ return base.TestCase.EX_OK
def execute(self):
'''
@@ -42,13 +42,13 @@ class FeatureBase(base.TestcaseBase):
pass
def parse_results(self, ret):
- exit_code = base.TestcaseBase.EX_OK
+ exit_code = base.TestCase.EX_OK
if ret == 0:
self.logger.info("{} OK".format(self.project_name))
self.criteria = 'PASS'
else:
self.logger.info("{} FAILED".format(self.project_name))
- exit_code = base.TestcaseBase.EX_RUN_ERROR
+ exit_code = base.TestCase.EX_RUN_ERROR
self.criteria = "FAIL"
return exit_code
diff --git a/functest/core/pytest_suite_runner.py b/functest/core/pytest_suite_runner.py
index f0ae265a..db60cefc 100644
--- a/functest/core/pytest_suite_runner.py
+++ b/functest/core/pytest_suite_runner.py
@@ -10,7 +10,7 @@ import unittest
import time
-class PyTestSuiteRunner(base.TestcaseBase):
+class PyTestSuiteRunner(base.TestCase):
"""
This superclass is designed to execute pre-configured unittest.TestSuite()
objects
@@ -42,9 +42,9 @@ class PyTestSuiteRunner(base.TestcaseBase):
# a result can be PASS or FAIL
# But in this case it means that the Execution was OK
# we shall distinguish Execution Error from FAIL results
- # TestcaseBase.EX_RUN_ERROR means that the test case was not run
+ # TestCase.EX_RUN_ERROR means that the test case was not run
# not that it was run but the result was FAIL
- exit_code = base.TestcaseBase.EX_OK
+ exit_code = base.TestCase.EX_OK
if ((result.errors and len(result.errors) > 0)
or (result.failures and len(result.failures) > 0)):
self.logger.info("%s FAILED" % self.case_name)
diff --git a/functest/core/testcase_base.py b/functest/core/testcase_base.py
index 2848073f..85d1fc74 100644
--- a/functest/core/testcase_base.py
+++ b/functest/core/testcase_base.py
@@ -13,7 +13,7 @@ import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
-class TestcaseBase(object):
+class TestCase(object):
EX_OK = os.EX_OK
EX_RUN_ERROR = os.EX_SOFTWARE
@@ -34,15 +34,15 @@ class TestcaseBase(object):
try:
assert self.criteria
if self.criteria == 'PASS':
- return TestcaseBase.EX_OK
+ return TestCase.EX_OK
except AssertionError:
self.logger.error("Please run test before checking the results")
- return TestcaseBase.EX_TESTCASE_FAILED
+ return TestCase.EX_TESTCASE_FAILED
def run(self, **kwargs):
# pylint: disable=unused-argument
self.logger.error("Run must be implemented")
- return TestcaseBase.EX_RUN_ERROR
+ return TestCase.EX_RUN_ERROR
def push_to_db(self):
try:
@@ -55,10 +55,10 @@ class TestcaseBase(object):
self.project_name, self.case_name, self.start_time,
self.stop_time, self.criteria, self.details):
self.logger.info("The results were successfully pushed to DB")
- return TestcaseBase.EX_OK
+ return TestCase.EX_OK
else:
self.logger.error("The results cannot be pushed to DB")
- return TestcaseBase.EX_PUSH_TO_DB_ERROR
+ return TestCase.EX_PUSH_TO_DB_ERROR
except Exception: # pylint: disable=broad-except
self.logger.exception("The results cannot be pushed to DB")
- return TestcaseBase.EX_PUSH_TO_DB_ERROR
+ return TestCase.EX_PUSH_TO_DB_ERROR
diff --git a/functest/core/vnf_base.py b/functest/core/vnf_base.py
index f5e86054..cd689c27 100644
--- a/functest/core/vnf_base.py
+++ b/functest/core/vnf_base.py
@@ -18,7 +18,7 @@ import testcase_base as base
from functest.utils.constants import CONST
-class VnfOnBoardingBase(base.TestcaseBase):
+class VnfOnBoardingBase(base.TestCase):
logger = ft_logger.Logger(__name__).getLogger()
@@ -58,7 +58,7 @@ class VnfOnBoardingBase(base.TestcaseBase):
except Exception:
self.logger.error("Error during VNF Onboarding environment" +
"creation", exc_info=True)
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ return base.TestCase.EX_TESTCASE_FAILED
# Deploy orchestrator
try:
@@ -87,7 +87,7 @@ class VnfOnBoardingBase(base.TestcaseBase):
vnf_ready_time - orchestrator_ready_time, 1)
except Exception:
self.logger.error("Error during VNF deployment", exc_info=True)
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ return base.TestCase.EX_TESTCASE_FAILED
# Test VNF
try:
@@ -100,7 +100,7 @@ class VnfOnBoardingBase(base.TestcaseBase):
test_vnf_done_time - vnf_ready_time, 1)
except Exception:
self.logger.error("Error when running VNF tests", exc_info=True)
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ return base.TestCase.EX_TESTCASE_FAILED
# Clean the system
self.clean()