aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2022-03-02 09:05:11 +0000
committerGerrit Code Review <gerrit@onap.org>2022-03-02 09:05:11 +0000
commit77a3e2f4c447d0f05547699251637eb14c3ec71c (patch)
tree42dfafb237b54b9814c04bdbaddec32f5652fc6a
parent0e8974a0061a9331cdad44bbfff1b9fd60cfd21f (diff)
parentf0a5bdf622433361b5a86da4aa216d542d2a8aa4 (diff)
Merge "[TEST] PNF macro nad CDS resource resoulution tests are failing on retry"
-rw-r--r--src/onaptests/scenario/cds_resource_resolution.py17
-rw-r--r--src/onaptests/scenario/pnf_macro.py17
2 files changed, 16 insertions, 18 deletions
diff --git a/src/onaptests/scenario/cds_resource_resolution.py b/src/onaptests/scenario/cds_resource_resolution.py
index 608734b..8c40916 100644
--- a/src/onaptests/scenario/cds_resource_resolution.py
+++ b/src/onaptests/scenario/cds_resource_resolution.py
@@ -79,15 +79,14 @@ class CDSResourceResolution(testcase.TestCase):
self.__logger.debug("CDS resource resolution run")
self.start_time = time.time()
try:
- self.test.execute()
- self.test.cleanup()
- self.result = 100
- except OnapTestException as exc:
- self.result = 0
- self.__logger.error(exc.error_message)
- except SDKException:
- self.result = 0
- self.__logger.error("SDK Exception")
+ for test_phase in (self.test.execute, self.test.cleanup):
+ try:
+ test_phase()
+ self.result += 50
+ except OnapTestException as exc:
+ self.__logger.error(exc.error_message)
+ except SDKException:
+ self.__logger.error("SDK Exception")
finally:
self.stop_time = time.time()
diff --git a/src/onaptests/scenario/pnf_macro.py b/src/onaptests/scenario/pnf_macro.py
index 931a332..b3c7d3e 100644
--- a/src/onaptests/scenario/pnf_macro.py
+++ b/src/onaptests/scenario/pnf_macro.py
@@ -119,15 +119,14 @@ class PnfMacro(testcase.TestCase):
"""Run PNF macro test."""
self.start_time = time.time()
try:
- self.test.execute()
- self.test.cleanup()
- self.result = 100
- except OnapTestException as exc:
- self.result = 0
- self.__logger.error(exc.error_message)
- except SDKException:
- self.result = 0
- self.__logger.error("SDK Exception")
+ for test_phase in (self.test.execute, self.test.cleanup):
+ try:
+ test_phase()
+ self.result += 50
+ except OnapTestException as exc:
+ self.__logger.error(exc.error_message)
+ except SDKException:
+ self.__logger.error("SDK Exception")
finally:
self.stop_time = time.time()