diff options
author | mrichomme <morgan.richomme@orange.com> | 2020-10-01 08:24:50 +0200 |
---|---|---|
committer | mrichomme <morgan.richomme@orange.com> | 2020-10-01 08:24:50 +0200 |
commit | 14df51104a7c3d6a74610e2238db17db4d28158b (patch) | |
tree | f727b0b88391513e452b9a79e5803977a774df8d | |
parent | 3e390f1d45785bca5beb1f5c2fa57ef59f6736e9 (diff) |
Update entry point to consider clean as part of the test
It is not just a teradown oepration for extra resources
We must verify that resources have been properly cleaned
Issue-ID: TEST-240
Signed-off-by: mrichomme <morgan.richomme@orange.com>
Change-Id: Ifc0301ba6f35b05d74dc43ac86203f11ada0789e
-rw-r--r-- | src/onaptests/scenario/basic_vm.py | 25 | ||||
-rw-r--r-- | src/onaptests/scenario/clearwater_ims.py | 27 |
2 files changed, 24 insertions, 28 deletions
diff --git a/src/onaptests/scenario/basic_vm.py b/src/onaptests/scenario/basic_vm.py index 2295fbf..15a6f5d 100644 --- a/src/onaptests/scenario/basic_vm.py +++ b/src/onaptests/scenario/basic_vm.py @@ -8,7 +8,7 @@ from onapsdk.configuration import settings from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep class BasicVm(testcase.TestCase): - """Onboard then instantiate a simple VM though ONAP.""" + """Onboard then instantiate a simple VM with ONAP.""" __logger = logging.getLogger(__name__) @@ -31,19 +31,18 @@ class BasicVm(testcase.TestCase): self.__logger.debug("start time") self.test.execute() self.__logger.info("VNF basic_vm successfully created") - if not settings.CLEANUP_FLAG: - self.result = 100 - self.stop_time = time.time() - return testcase.TestCase.EX_OK - - def clean(self): - """Clean VNF.""" + 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 basic_vm cleanup called") time.sleep(settings.CLEANUP_ACTIVITY_TIMER) - try: self.test.cleanup() - except ValueError as error: - self.__logger.info("service instance deleted as expected {0}".format(error)) self.result = 100 - self.stop_time = time.time() - return testcase.TestCase.EX_OK + else: + self.__logger.info("No cleanup requested. Test completed.") + self.result = 100 + + + def clean(self): + """Clean Additional resources if needed.""" + pass diff --git a/src/onaptests/scenario/clearwater_ims.py b/src/onaptests/scenario/clearwater_ims.py index ab3ad48..83a654e 100644 --- a/src/onaptests/scenario/clearwater_ims.py +++ b/src/onaptests/scenario/clearwater_ims.py @@ -8,7 +8,7 @@ from onapsdk.configuration import settings from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep class ClearwaterIms(testcase.TestCase): - """Onboard then instantiate a simple VM though ONAP.""" + """Onboard then instantiate a clearwater vIMS with ONAP.""" __logger = logging.getLogger(__name__) @@ -30,21 +30,18 @@ class ClearwaterIms(testcase.TestCase): self.start_time = time.time() self.__logger.debug("start time") self.test.execute() - self.__logger.info("vIMS successfully created") - # Space for running additional tests on the deployed VNF here - if not settings.CLEANUP_FLAG: - self.result = 100 - self.stop_time = time.time() - return testcase.TestCase.EX_OK - - def clean(self): - """Clean VNF.""" + 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) - try: self.test.cleanup() - except ValueError as error: - self.__logger.info("service instance deleted as expected {0}".format(error)) self.result = 100 - self.stop_time = time.time() - return testcase.TestCase.EX_OK + else: + self.__logger.info("No cleanup requested. Test completed.") + self.result = 100 + + def clean(self): + """Clean Additional resources if needed.""" + pass |