diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-03-10 16:14:29 +0100 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2017-03-10 17:03:11 +0100 |
commit | 6ac6937237bc03b27935f71bbb33c0abffc1e993 (patch) | |
tree | af8e6e88da1d8bf16ce1d6ffac5ba2c85fb86e9b /functest/core | |
parent | 6587f877a3c6e2954d9e32a0652c6f0d1d356ab7 (diff) |
Remove raise exceptions
until exceptions are better managed in abstraction
Currently it triggers an exit from the jenkins job
and prevent other tests to be run
Change-Id: Id3b18c1d6d3b786fc78456b3ad51963d2cbb2cc1
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'functest/core')
-rw-r--r-- | functest/core/vnf_base.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/functest/core/vnf_base.py b/functest/core/vnf_base.py index daf8b806..0300dd22 100644 --- a/functest/core/vnf_base.py +++ b/functest/core/vnf_base.py @@ -40,7 +40,8 @@ class VnfOnBoardingBase(base.TestcaseBase): self.tenant_description = CONST.__getattribute__( 'vnf_{}_tenant_description'.format(self.case_name)) except: - raise Exception("Unknown VNF case=" + self.case_name) + # raise Exception("Unknown VNF case=" + self.case_name) + self.logger.error("Unknown VNF case={}".format(self.case_name)) try: self.images = CONST.__getattribute__( @@ -81,7 +82,7 @@ class VnfOnBoardingBase(base.TestcaseBase): vnf_ready_time - orchestrator_ready_time, 1) except Exception: self.logger.error("Error during VNF deployment", exc_info=True) - raise Exception("Error during VNF deployment") + return base.TestcaseBase.EX_TESTCASE_FAILED # Test VNF try: @@ -94,7 +95,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) - raise Exception("Error when running VNF tests") + return base.TestcaseBase.EX_TESTCASE_FAILED # Clean the system self.clean() @@ -178,11 +179,11 @@ class VnfOnBoardingBase(base.TestcaseBase): # TODO see how to use built-in exception from releng module def deploy_vnf(self): self.logger.error("VNF must be deployed") - raise Exception("VNF not deployed") + return base.TestcaseBase.EX_TESTCASE_FAILED def test_vnf(self): self.logger.error("VNF must be tested") - raise Exception("VNF not tested") + return base.TestcaseBase.EX_TESTCASE_FAILED def clean(self): self.logger.info("test cleaning") @@ -230,4 +231,5 @@ class VnfOnBoardingBase(base.TestcaseBase): part = inspect.stack()[1][3] self.details[part]['status'] = 'FAIL' self.details[part]['result'] = error_msg - raise Exception(error_msg) + self.logger.error("Step failure:{}".format(error_msg)) + return base.TestcaseBase.EX_TESTCASE_FAILED |