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/cds_blueprint_enrichment.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/onaptests/scenario/cds_blueprint_enrichment.py') diff --git a/src/onaptests/scenario/cds_blueprint_enrichment.py b/src/onaptests/scenario/cds_blueprint_enrichment.py index 502c92d..c1df63e 100644 --- a/src/onaptests/scenario/cds_blueprint_enrichment.py +++ b/src/onaptests/scenario/cds_blueprint_enrichment.py @@ -5,9 +5,11 @@ import logging import time from onapsdk.configuration import settings +from onapsdk.exceptions import SDKException from xtesting.core import testcase from onaptests.steps.onboard.cds import CbaEnrichStep +from onaptests.utils.exceptions import OnapTestException class CDSBlueprintEnrichment(testcase.TestCase): @@ -30,8 +32,12 @@ class CDSBlueprintEnrichment(testcase.TestCase): def run(self): self.__logger.debug("CDS blueprint enrichment run") self.start_time = time.time() - self.test.execute() - self.result = 100 + try: + self.test.execute() + self.result = 100 + except (OnapTestException, SDKException) as exc: + self.result = 0 + self.__logger.error(exc.error_message) self.stop_time = time.time() def clean(self): -- cgit 1.2.3-korg