diff options
Diffstat (limited to 'src/onaptests/scenario')
-rw-r--r-- | src/onaptests/scenario/basic_cnf.py | 29 | ||||
-rw-r--r-- | src/onaptests/scenario/basic_network.py | 13 | ||||
-rw-r--r-- | src/onaptests/scenario/basic_vm.py | 23 | ||||
-rw-r--r-- | src/onaptests/scenario/clearwater_ims.py | 7 |
4 files changed, 13 insertions, 59 deletions
diff --git a/src/onaptests/scenario/basic_cnf.py b/src/onaptests/scenario/basic_cnf.py index 30c3c3b..306205f 100644 --- a/src/onaptests/scenario/basic_cnf.py +++ b/src/onaptests/scenario/basic_cnf.py @@ -5,6 +5,7 @@ import time from xtesting.core import testcase from onapsdk.configuration import settings + import onaptests.utils.exceptions as onap_test_exceptions from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep @@ -41,33 +42,9 @@ class BasicCnf(testcase.TestCase): else: self.__logger.info("No cleanup requested. Test completed.") self.result = 100 - except onap_test_exceptions.TestConfigurationException: - self.result = 0 - self.__logger.error("Basic CNF configuration error") - except onap_test_exceptions.ServiceInstantiateException: - self.result = 0 - self.__logger.error("Basic CNF service instantiation error") - except onap_test_exceptions.ServiceCleanupException: - self.result = 0 - self.__logger.error("Basic CNF service instance cleanup error") - except onap_test_exceptions.VnfInstantiateException: - self.result = 0 - self.__logger.error("Basic CNF Vnf instantiation error") - except onap_test_exceptions.VnfCleanupException: - self.result = 0 - self.__logger.error("Basic CNF Vnf instance cleanup error") - except onap_test_exceptions.ProfileInformationException: - self.__logger.error("Missing k8s profile information") - self.result = 0 - except onap_test_exceptions.ProfileCleanupException: - self.__logger.error("K8s profile deletion failed") - self.result = 0 - except onap_test_exceptions.VfModuleInstantiateException: - self.result = 0 - self.__logger.error("Basic CNF Module instantiation error") - except onap_test_exceptions.VfModuleCleanupException: - self.__logger.error("Basic CNF Module cleanup failed.") + except onap_test_exceptions.OnapTestException as exc: self.result = 0 + self.__logger.error(exc.error_message) finally: self.stop_time = time.time() diff --git a/src/onaptests/scenario/basic_network.py b/src/onaptests/scenario/basic_network.py index de465d3..8aafd32 100644 --- a/src/onaptests/scenario/basic_network.py +++ b/src/onaptests/scenario/basic_network.py @@ -46,18 +46,9 @@ class BasicNetwork(testcase.TestCase): else: self.__logger.info("No cleanup requested. Test completed.") self.result = 100 - except onap_test_exceptions.ServiceInstantiateException: - self.__logger.error("Basic network service instantiation failed.") - self.result = 0 - except onap_test_exceptions.ServiceInstantiateException: - self.__logger.error("Basic network service cleanup failed.") - self.result = 0 - except onap_test_exceptions.NetworkInstantiateException: - self.__logger.error("Basic network VL instantiation failed.") - self.result = 0 - except onap_test_exceptions.NetworkCleanupException: - self.__logger.error("Basic network VL cleanup failed.") + except onap_test_exceptions.OnapTestException as exc: self.result = 0 + self.__logger.error(exc.error_message) finally: self.stop_time = time.time() diff --git a/src/onaptests/scenario/basic_vm.py b/src/onaptests/scenario/basic_vm.py index 35cedbc..cbf9b7c 100644 --- a/src/onaptests/scenario/basic_vm.py +++ b/src/onaptests/scenario/basic_vm.py @@ -5,6 +5,7 @@ import time from xtesting.core import testcase from onapsdk.configuration import settings + import onaptests.utils.exceptions as onap_test_exceptions from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep @@ -42,27 +43,9 @@ class BasicVm(testcase.TestCase): else: self.__logger.info("No cleanup requested. Test completed.") self.result = 100 - except onap_test_exceptions.TestConfigurationException: - self.result = 0 - self.__logger.error("Basic VM configuration error") - except onap_test_exceptions.ServiceInstantiateException: - self.result = 0 - self.__logger.error("Basic VM instantiation error") - except onap_test_exceptions.ServiceCleanupException: - self.result = 0 - self.__logger.error("Basic VM instance cleanup error") - except onap_test_exceptions.VnfInstantiateException: - self.result = 0 - self.__logger.error("Basic VM Vnf instantiation error") - except onap_test_exceptions.VnfCleanupException: - self.result = 0 - self.__logger.error("Basic VM Vnf instance cleanup error") - except onap_test_exceptions.VfModuleInstantiateException: - self.result = 0 - self.__logger.error("Basic VM Module instantiation error") - except onap_test_exceptions.VfModuleCleanupException: - self.__logger.error("Basic VM Module cleanup failed.") + except onap_test_exceptions.OnapTestException as exc: self.result = 0 + self.__logger.error(exc.error_message) finally: self.stop_time = time.time() diff --git a/src/onaptests/scenario/clearwater_ims.py b/src/onaptests/scenario/clearwater_ims.py index 0177e02..8a68fa9 100644 --- a/src/onaptests/scenario/clearwater_ims.py +++ b/src/onaptests/scenario/clearwater_ims.py @@ -5,6 +5,8 @@ import time from xtesting.core import testcase from onapsdk.configuration import settings + +import onaptests.utils.exceptions as onap_test_exceptions from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep class ClearwaterIms(testcase.TestCase): @@ -42,9 +44,10 @@ class ClearwaterIms(testcase.TestCase): 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.") + except onap_test_exceptions.OnapTestException as exc: self.result = 0 + self.__logger.error(exc.error_message) + finally: self.stop_time = time.time() def clean(self): |