From 1b96f9912524dddf6d656e096626800df32db0be Mon Sep 17 00:00:00 2001 From: Michal Jagiello Date: Wed, 10 Feb 2021 21:19:59 +0000 Subject: [INT] Catch all onaptests and onapsdk exceptions for scenarios Catch onaptests and onapsdk exceptions in scenario to generate test report if test fails Issue-ID: INT-1852 Signed-off-by: Michal Jagiello Change-Id: Id9772fea10dc5aa323437e72c6fe5ddb4c6caabb --- src/onaptests/scenario/basic_cnf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/onaptests/scenario/basic_cnf.py') diff --git a/src/onaptests/scenario/basic_cnf.py b/src/onaptests/scenario/basic_cnf.py index 306205f..4d98398 100644 --- a/src/onaptests/scenario/basic_cnf.py +++ b/src/onaptests/scenario/basic_cnf.py @@ -5,9 +5,10 @@ import time from xtesting.core import testcase from onapsdk.configuration import settings +from onapsdk.exceptions import SDKException -import onaptests.utils.exceptions as onap_test_exceptions from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep +from onaptests.utils.exceptions import OnapTestException class BasicCnf(testcase.TestCase): """Onboard then instantiate a simple CNF with ONAP.""" @@ -42,7 +43,7 @@ class BasicCnf(testcase.TestCase): else: self.__logger.info("No cleanup requested. Test completed.") self.result = 100 - except onap_test_exceptions.OnapTestException as exc: + except (OnapTestException, SDKException) as exc: self.result = 0 self.__logger.error(exc.error_message) finally: -- cgit 1.2.3-korg