diff options
author | mrichomme <morgan.richomme@orange.com> | 2021-01-18 15:26:53 +0100 |
---|---|---|
committer | mrichomme <morgan.richomme@orange.com> | 2021-05-25 16:33:42 +0200 |
commit | 5c8ef55bbc031e53910b3c05dcfe0366d2245354 (patch) | |
tree | 77179dd538de796a54d12eb064070eb912dc2647 | |
parent | 8c522eb37abd4ff893a2a42b69b8ef9e86db464f (diff) |
[TESTCASE] fix basic_onboard scenario
the run_basic_onboard.py is working, but the scenario used by xtesting
cannot work properly.
Tested on Daily master lab.
Issue-ID: TEST-288
Signed-off-by: mrichomme <morgan.richomme@orange.com>
Change-Id: Ibc5482607a738692a05260913eeb322a0933ff03
(cherry picked from commit d6ab274b76e48164d3aefe702cf8ea2f87c98004)
-rw-r--r-- | src/onaptests/scenario/basic_onboard.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/onaptests/scenario/basic_onboard.py b/src/onaptests/scenario/basic_onboard.py index 3695975..af689bd 100644 --- a/src/onaptests/scenario/basic_onboard.py +++ b/src/onaptests/scenario/basic_onboard.py @@ -1,12 +1,12 @@ - #!/usr/bin/env python """Basic Onboard test case.""" import logging import time from xtesting.core import testcase -#from onapsdk.configuration import settings -import onaptests.utils.exceptions as onap_test_exceptions -#from onaptests.steps.onboard.service import YamlTemplateServiceOnboardStep +from onapsdk.configuration import settings +from onapsdk.exceptions import SDKException +from onaptests.steps.onboard.service import YamlTemplateServiceOnboardStep +from onaptests.utils.exceptions import OnapTestException class BasicOnboard(testcase.TestCase): """Onboard a simple VM with ONAP.""" @@ -20,6 +20,8 @@ class BasicOnboard(testcase.TestCase): kwargs["case_name"] = 'basic_onboard' super(BasicOnboard, self).__init__(**kwargs) self.__logger.debug("BasicOnboard init started") + self.test = YamlTemplateServiceOnboardStep( + cleanup=settings.CLEANUP_FLAG) self.start_time = None self.stop_time = None self.result = 0 @@ -31,9 +33,13 @@ class BasicOnboard(testcase.TestCase): try: self.test.execute() self.__logger.info("VNF basic_vm successfully onboarded") - except onap_test_exceptions.OnapTestException as exc: + 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") finally: self.stop_time = time.time() |