aboutsummaryrefslogtreecommitdiffstats
path: root/functest/core
diff options
context:
space:
mode:
authorboucherv <valentin.boucher@orange.com>2017-03-20 10:52:48 +0100
committerboucherv <valentin.boucher@orange.com>2017-03-20 10:52:48 +0100
commit3575dcb2a262c623dd4ded0823bc78adf3a1012e (patch)
tree900c271c143e40a36aa809a8f7ba7470a4d75094 /functest/core
parent875bae259b42bf178101574f3516f87b3708a533 (diff)
[vnf_base] improve exception
Return on part of previous changes in commit: 30257 https://gerrit.opnfv.org/gerrit/#/c/30257/ Change-Id: I11b33ee2a6f9d4cbcf1449006b47be508fce655e Signed-off-by: boucherv <valentin.boucher@orange.com>
Diffstat (limited to 'functest/core')
-rw-r--r--functest/core/vnf_base.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/functest/core/vnf_base.py b/functest/core/vnf_base.py
index 0300dd22..f5e86054 100644
--- a/functest/core/vnf_base.py
+++ b/functest/core/vnf_base.py
@@ -52,8 +52,13 @@ class VnfOnBoardingBase(base.TestcaseBase):
def execute(self):
self.start_time = time.time()
# Prepare the test (Create Tenant, User, ...)
- self.logger.info("Create VNF Onboarding environment")
- self.prepare()
+ try:
+ self.logger.info("Create VNF Onboarding environment")
+ self.prepare()
+ except Exception:
+ self.logger.error("Error during VNF Onboarding environment" +
+ "creation", exc_info=True)
+ return base.TestcaseBase.EX_TESTCASE_FAILED
# Deploy orchestrator
try:
@@ -179,11 +184,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")
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ raise Exception("VNF not deployed")
def test_vnf(self):
self.logger.error("VNF must be tested")
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ raise Exception("VNF not tested")
def clean(self):
self.logger.info("test cleaning")
@@ -232,4 +237,4 @@ class VnfOnBoardingBase(base.TestcaseBase):
self.details[part]['status'] = 'FAIL'
self.details[part]['result'] = error_msg
self.logger.error("Step failure:{}".format(error_msg))
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ raise Exception(error_msg)