aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/scenario
diff options
context:
space:
mode:
authorAleksandr Taranov <aleksandr.taranov@telekom.com>2023-05-25 17:21:34 +0300
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2023-05-31 11:18:21 +0000
commit8f3c1e06049f242849af74b99fb60b41cebdc578 (patch)
tree8bba93e7ad367780097de046050cfe9043905d2c /src/onaptests/scenario
parentea72aa01e864b6ddf3145d51d060077da00526d3 (diff)
Create SDNC Sanity test
Issue-ID: TEST-395 Signed-off-by: Aleksandr Taranov <aleksandr.taranov@telekom.com> Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> Change-Id: I2a035beb74510013eb8e04aecd90c648af77fe28
Diffstat (limited to 'src/onaptests/scenario')
-rw-r--r--src/onaptests/scenario/basic_sdnc.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/onaptests/scenario/basic_sdnc.py b/src/onaptests/scenario/basic_sdnc.py
new file mode 100644
index 0000000..d791080
--- /dev/null
+++ b/src/onaptests/scenario/basic_sdnc.py
@@ -0,0 +1,45 @@
+import logging
+import time
+from xtesting.core import testcase
+
+from onapsdk.configuration import settings
+from onapsdk.exceptions import SDKException
+
+from onaptests.steps.instantiate.sdnc_service import UpdateSdncService
+from onaptests.utils.exceptions import OnapTestException
+
+
+class BasicSdnc(testcase.TestCase):
+ """Create SDNC service.
+ Check and delete the service.
+ """
+
+ __logger = logging.getLogger()
+
+ def __init__(self, **kwargs):
+ """Init Basic SDNC use case."""
+ if "case_name" not in kwargs:
+ kwargs["case_name"] = 'basic_SDNC'
+ super().__init__(**kwargs)
+ self.__logger.debug("Basic SDNC init started")
+ self.test = UpdateSdncService(cleanup=settings.CLEANUP_FLAG)
+
+ def run(self):
+ """Run basic SDNC 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.exception(exc.error_message)
+ except SDKException:
+ self.result = 0
+ self.__logger.exception("SDK Exception")
+ finally:
+ self.stop_time = time.time()
+
+ def clean(self):
+ """Generate report."""
+ self.test.reports_collection.generate_report()