aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/scenario/pnf_macro.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/onaptests/scenario/pnf_macro.py')
-rw-r--r--src/onaptests/scenario/pnf_macro.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/onaptests/scenario/pnf_macro.py b/src/onaptests/scenario/pnf_macro.py
index baa44b4..a045a37 100644
--- a/src/onaptests/scenario/pnf_macro.py
+++ b/src/onaptests/scenario/pnf_macro.py
@@ -1,13 +1,16 @@
"""Instantiate service with PNF using SO macro flow."""
+import time
from yaml import load
from xtesting.core import testcase
from onapsdk.configuration import settings
+from onapsdk.exceptions import SDKException
from onaptests.steps.base import YamlTemplateBaseStep
from onaptests.steps.onboard.cds import CbaEnrichStep
from onaptests.steps.simulator.pnf_simulator_cnf.pnf_register import PnfSimulatorCnfRegisterStep
from onaptests.steps.instantiate.service_macro import YamlTemplateServiceMacroInstantiateStep
+from onaptests.utils.exceptions import OnapTestException
class PnfMacroScenarioStep(YamlTemplateBaseStep):
@@ -107,8 +110,16 @@ class PnfMacro(testcase.TestCase):
def run(self):
"""Run PNF macro test."""
- self.test.execute()
- self.test.cleanup()
+ self.start_time = time.time()
+ try:
+ self.test.execute()
+ self.test.cleanup()
+ self.result = 100
+ except (OnapTestException, SDKException) as exc:
+ self.result = 0
+ self.__logger.error(exc.error_message)
+ finally:
+ self.stop_time = time.time()
def clean(self):
"""Generate report."""