aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/scenario/clearwater_ims.py
diff options
context:
space:
mode:
authormrichomme <morgan.richomme@orange.com>2020-10-13 12:52:24 +0200
committermrichomme <morgan.richomme@orange.com>2020-10-14 11:27:35 +0200
commitb7b9796d16a2e53e0e58ae9888dade1e89a0cc19 (patch)
tree379944906ed2c5a837dc1e09810235fd03a37e8b /src/onaptests/scenario/clearwater_ims.py
parent6276bed4df9b8458c4b6805edab81652fb15de76 (diff)
Improve xtesting integration
All the exceptions shall be caught by the use case Issue-ID: TEST-257 Signed-off-by: mrichomme <morgan.richomme@orange.com> Change-Id: Ie2762ad869d8984ce2125db4a8ef4990ee50f82a Signed-off-by: mrichomme <morgan.richomme@orange.com>
Diffstat (limited to 'src/onaptests/scenario/clearwater_ims.py')
-rw-r--r--src/onaptests/scenario/clearwater_ims.py34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/onaptests/scenario/clearwater_ims.py b/src/onaptests/scenario/clearwater_ims.py
index 83a654e..0177e02 100644
--- a/src/onaptests/scenario/clearwater_ims.py
+++ b/src/onaptests/scenario/clearwater_ims.py
@@ -29,19 +29,27 @@ class ClearwaterIms(testcase.TestCase):
"""Run vIMS test."""
self.start_time = time.time()
self.__logger.debug("start time")
- self.test.execute()
- self.__logger.info("VNF clearwater IMS successfully created")
- self.stop_time = time.time()
- # The cleanup is part of the test, not only a teardown action
- if settings.CLEANUP_FLAG:
- self.__logger.info("VNF clearwater IMS cleanup called")
- time.sleep(settings.CLEANUP_ACTIVITY_TIMER)
- self.test.cleanup()
- self.result = 100
- else:
- self.__logger.info("No cleanup requested. Test completed.")
- self.result = 100
+ try:
+ self.test.execute()
+ self.__logger.info("VNF clearwater IMS successfully created")
+ # The cleanup is part of the test, not only a teardown action
+ if settings.CLEANUP_FLAG:
+ self.__logger.info("VNF clearwater IMS cleanup called")
+ time.sleep(settings.CLEANUP_ACTIVITY_TIMER)
+ self.test.cleanup()
+ self.result = 100
+ else:
+ self.__logger.info("No cleanup requested. Test completed.")
+ self.result = 100
+ self.stop_time = time.time()
+ except:
+ self.__logger.error("Clearwater IMS test case failed.")
+ self.result = 0
+ self.stop_time = time.time()
def clean(self):
"""Clean Additional resources if needed."""
- pass
+ try:
+ self.test.reports_collection.generate_report()
+ except:
+ self.__logger.error("Impossible to generate reporting")