xtesting==0.91.0
avionix>=0.4.5
openstacksdk>=0.61.0
-onapsdk==10.5.0
+onapsdk==10.6.0
jinja2>3
kubernetes>=22.6.0
setuptools==65.3.0
"""Basic Clamp test case."""
import logging
import time
-from xtesting.core import testcase
+
from onapsdk.configuration import settings
-from onapsdk.exceptions import SDKException, APIError
+from onapsdk.exceptions import APIError, SDKException
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.loop.clamp import ClampStep
from onaptests.utils.exceptions import OnapTestException
-class BasicClamp(testcase.TestCase):
+
+
+class BasicClamp(ScenarioBase):
"""Onboard, update a model with a loop, design the loop and deploy it."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init Basic Clamp, onboard a VM, design and deploy a loop with CLAMP."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_clamp'
- super(BasicClamp, self).__init__(**kwargs)
- self.__logger.debug("Basic CLAMP init started")
+ super().__init__('basic_clamp', **kwargs)
self.test = ClampStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None
self.stop_time = None
self.result = 0
+
def run(self):
"""Run Basic CLAMP onap test."""
self.start_time = time.time()
self.__logger.exception("SDK exception")
finally:
self.stop_time = time.time()
+
def clean(self):
"""Clean Additional resources if needed."""
self.__logger.info("Generate Test report")
import logging
import time
-from xtesting.core import testcase
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-
-from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep
+from onaptests.scenario.scenario_base import ScenarioBase
+from onaptests.steps.instantiate.vf_module_ala_carte import \
+ YamlTemplateVfModuleAlaCarteInstantiateStep
from onaptests.utils.exceptions import OnapTestException
-class BasicCnf(testcase.TestCase):
+
+class BasicCnf(ScenarioBase):
"""Onboard then instantiate a simple CNF with ONAP."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init BasicCnf."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_cnf'
- super(BasicCnf, self).__init__(**kwargs)
- self.__logger.debug("BasicCnf init started")
+ super().__init__('basic_cnf', **kwargs)
self.test = YamlTemplateVfModuleAlaCarteInstantiateStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None
"""Instantiate basic cnf using SO macro flow."""
import logging
import time
-from yaml import load, SafeLoader
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-from xtesting.core import testcase
-
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.base import YamlTemplateBaseStep
+from onaptests.steps.instantiate.service_macro import \
+ YamlTemplateServiceMacroInstantiateStep
from onaptests.steps.onboard.cds import CbaPublishStep
from onaptests.utils.exceptions import OnapTestException
-from onaptests.steps.instantiate.service_macro import YamlTemplateServiceMacroInstantiateStep
+from yaml import SafeLoader, load
class BasicCnfMacroStep(YamlTemplateBaseStep):
return settings.SERVICE_INSTANCE_NAME
-class BasicCnfMacro(testcase.TestCase):
+class BasicCnfMacro(ScenarioBase):
"""Instantiate a basic cnf macro."""
__logger = logging.getLogger()
def __init__(self, **kwargs):
"""Init Basic Cnf Macro use case."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_cnf_macro'
- super().__init__(**kwargs)
- self.__logger.debug("Basic Cnf macro init started")
+ super().__init__('basic_cnf_macro', **kwargs)
self.test = BasicCnfMacroStep(cleanup=settings.CLEANUP_FLAG)
def run(self):
"""Basic CPS test case."""
import logging
import time
-from xtesting.core import testcase
+
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.onboard.cps import CreateCpsAnchorNodeStep
from onaptests.utils.exceptions import OnapTestException
-class BasicCps(testcase.TestCase):
+
+class BasicCps(ScenarioBase):
"""Create CPS resources:
- dataspace
- schemaset
def __init__(self, **kwargs):
"""Init Basic CPS."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_cps'
- super().__init__(**kwargs)
- self.__logger.debug("BasicCps init started")
+ super().__init__('basic_cps', **kwargs)
self.test = CreateCpsAnchorNodeStep(cleanup=settings.CLEANUP_FLAG)
self.start_time = None
self.stop_time = None
import logging
import time
-from xtesting.core import testcase
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-
-from onaptests.steps.instantiate.vl_ala_carte import YamlTemplateVlAlaCarteInstantiateStep
+from onaptests.scenario.scenario_base import ScenarioBase
+from onaptests.steps.instantiate.vl_ala_carte import \
+ YamlTemplateVlAlaCarteInstantiateStep
from onaptests.utils.exceptions import OnapTestException
-class BasicNetwork(testcase.TestCase):
+
+class BasicNetwork(ScenarioBase):
"""Onboard then instantiate a simple Network with ONAP."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init Basic Network use case."""
# import basic_network_nomulticloud_settings needed
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_network'
- super(BasicNetwork, self).__init__(**kwargs)
- self.__logger.debug("BasicNetwork init started")
+ super().__init__('basic_network', **kwargs)
self.test = YamlTemplateVlAlaCarteInstantiateStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None
"""Basic Onboard test case."""
import logging
import time
-from xtesting.core import testcase
+
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.onboard.service import YamlTemplateServiceOnboardStep
from onaptests.utils.exceptions import OnapTestException
-class BasicOnboard(testcase.TestCase):
+
+class BasicOnboard(ScenarioBase):
"""Onboard a simple VM with ONAP."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init BasicOnboard."""
# import basic_onboard_settings needed
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_onboard'
- super(BasicOnboard, self).__init__(**kwargs)
- self.__logger.debug("BasicOnboard init started")
+ super().__init__('basic_onboard', **kwargs)
self.test = YamlTemplateServiceOnboardStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None
import logging
import time
-from xtesting.core import testcase
-
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.instantiate.sdnc_service import TestSdncStep
from onaptests.utils.exceptions import OnapTestException
-class BasicSdnc(testcase.TestCase):
+class BasicSdnc(ScenarioBase):
"""Create SDNC service.
Check and delete the service.
"""
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")
+ super().__init__('basic_sdnc', **kwargs)
self.test = TestSdncStep(cleanup=settings.CLEANUP_FLAG)
def run(self):
import logging
import time
-from xtesting.core import testcase
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-
-from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep
+from onaptests.scenario.scenario_base import ScenarioBase
+from onaptests.steps.instantiate.vf_module_ala_carte import \
+ YamlTemplateVfModuleAlaCarteInstantiateStep
from onaptests.utils.exceptions import OnapTestException
-class BasicVm(testcase.TestCase):
+
+class BasicVm(ScenarioBase):
"""Onboard then instantiate a simple VM with ONAP."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init BasicVM."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_vm'
- super(BasicVm, self).__init__(**kwargs)
- self.__logger.debug("BasicVm init started")
+ super().__init__('basic_vm', **kwargs)
self.test = YamlTemplateVfModuleAlaCarteInstantiateStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None
"""Instantiate basic vm using SO macro flow."""
import logging
import time
-from yaml import load, SafeLoader
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-from xtesting.core import testcase
-
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.base import YamlTemplateBaseStep
+from onaptests.steps.instantiate.service_macro import \
+ YamlTemplateServiceMacroInstantiateStep
from onaptests.steps.onboard.cds import CbaPublishStep
from onaptests.utils.exceptions import OnapTestException
-from onaptests.steps.instantiate.service_macro import YamlTemplateServiceMacroInstantiateStep
+from yaml import SafeLoader, load
class BasicVmMacroStep(YamlTemplateBaseStep):
return settings.SERVICE_INSTANCE_NAME
-class BasicVmMacro(testcase.TestCase):
+class BasicVmMacro(ScenarioBase):
"""Instantiate a basic vm macro."""
__logger = logging.getLogger()
def __init__(self, **kwargs):
"""Init Basic Macro use case."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_vm_macro'
- super().__init__(**kwargs)
- self.__logger.debug("Basic VM macro init started")
+ super().__init__('basic_vm_macro', **kwargs)
self.test = BasicVmMacroStep(cleanup=settings.CLEANUP_FLAG)
def run(self):
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-from xtesting.core import testcase
-
+from onaptests.scenario.scenario_base import ScenarioBase
+from onaptests.steps.instantiate.service_macro import \
+ YamlTemplateServiceMacroInstantiateStep
from onaptests.utils.exceptions import OnapTestException
-from onaptests.steps.instantiate.service_macro import YamlTemplateServiceMacroInstantiateStep
-class BasicVmMacroStability(testcase.TestCase):
+class BasicVmMacroStability(ScenarioBase):
"""Instantiate a basic vm macro."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init Basic Macro use case."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_vm_macro_stability'
- super().__init__(**kwargs)
- self.__logger.debug("Basic VM macro stability init started")
+ super().__init__('basic_vm_macro_stability', **kwargs)
self.test = YamlTemplateServiceMacroInstantiateStep(cleanup=settings.CLEANUP_FLAG)
def run(self):
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-from xtesting.core import testcase
-
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.onboard.cds import CbaEnrichStep
from onaptests.utils.exceptions import OnapTestException
-class CDSBlueprintEnrichment(testcase.TestCase):
+class CDSBlueprintEnrichment(ScenarioBase):
"""Enrich simple blueprint using CDS blueprintprocessor."""
__logger = logging.getLogger()
def __init__(self, **kwargs):
"""Init CDS blueprint enrichment use case."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_cds'
- super(CDSBlueprintEnrichment, self).__init__(**kwargs)
- self.__logger.debug("CDS blueprint enrichment initialization")
+ super().__init__('basic_cds', **kwargs)
self.test = CbaEnrichStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-from xtesting.core import testcase
-
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.base import BaseStep
from onaptests.steps.onboard.cds import CbaProcessStep
-from onaptests.steps.simulator.cds_mockserver import CdsMockserverCnfConfigureStep
+from onaptests.steps.simulator.cds_mockserver import \
+ CdsMockserverCnfConfigureStep
from onaptests.utils.exceptions import OnapTestException
return "PythonSDK-tests"
-class CDSResourceResolution(testcase.TestCase):
+class CDSResourceResolution(ScenarioBase):
"""Enrich simple blueprint using CDS blueprintprocessor."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init CDS resource resolution use case."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'basic_cds'
- super().__init__(**kwargs)
- self.__logger.debug("CDS resource resolution initialization")
+ super().__init__('basic_cds', **kwargs)
self.test = CDSResourceResolutionStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None
import logging
import time
-from xtesting.core import testcase
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-
-from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep
+from onaptests.scenario.scenario_base import ScenarioBase
+from onaptests.steps.instantiate.vf_module_ala_carte import \
+ YamlTemplateVfModuleAlaCarteInstantiateStep
from onaptests.utils.exceptions import OnapTestException
-class ClearwaterIms(testcase.TestCase):
+
+class ClearwaterIms(ScenarioBase):
"""Onboard then instantiate a clearwater vIMS with ONAP."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init Clearwater IMS."""
# import clearwater_ims_nomulticloud_settings needed
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'clearwater_ims'
- super(ClearwaterIms, self).__init__(**kwargs)
- self.__logger.debug("vIMS init started")
+ super().__init__('clearwater_ims', **kwargs)
self.test = YamlTemplateVfModuleAlaCarteInstantiateStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None
import logging
import time
-from yaml import load, SafeLoader
-
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-from xtesting.core import testcase
-
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.base import YamlTemplateBaseStep
+from onaptests.steps.instantiate.service_macro import \
+ YamlTemplateServiceMacroInstantiateStep
from onaptests.steps.onboard.cds import CbaPublishStep
from onaptests.utils.exceptions import OnapTestException
-from onaptests.steps.instantiate.service_macro import YamlTemplateServiceMacroInstantiateStep
+from yaml import SafeLoader, load
class MultiVnfUbuntuMacroStep(YamlTemplateBaseStep):
return settings.SERVICE_INSTANCE_NAME
-class MultiVnfUbuntuMacro(testcase.TestCase):
+class MultiVnfUbuntuMacro(ScenarioBase):
"""Instantiate a basic vm macro."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init Basic Macro use case."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'nso_ubuntu_macro'
- super().__init__(**kwargs)
- self.__logger.debug("NSO Ubuntu macro init started")
+ super().__init__('nso_ubuntu_macro', **kwargs)
self.test = MultiVnfUbuntuMacroStep(cleanup=settings.CLEANUP_FLAG)
def run(self):
"""Instantiate service with PNF using SO macro flow."""
import logging
import time
-from yaml import load, SafeLoader
-from xtesting.core import testcase
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.base import YamlTemplateBaseStep
+from onaptests.steps.instantiate.service_macro import \
+ YamlTemplateServiceMacroInstantiateStep
from onaptests.steps.onboard.cds import CbaEnrichStep
-from onaptests.steps.simulator.pnf_simulator_cnf.pnf_register import PnfSimulatorCnfRegisterStep
-from onaptests.steps.instantiate.service_macro import YamlTemplateServiceMacroInstantiateStep
+from onaptests.steps.simulator.pnf_simulator_cnf.pnf_register import \
+ PnfSimulatorCnfRegisterStep
from onaptests.utils.exceptions import OnapTestException
+from yaml import SafeLoader, load
class PnfMacroScenarioStep(YamlTemplateBaseStep):
return settings.SERVICE_INSTANCE_NAME
-class PnfMacro(testcase.TestCase):
+class PnfMacro(ScenarioBase):
"""Run PNF simulator and onboard then instantiate a service with PNF."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init Basic Network use case."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'pnf_macro'
- super().__init__(**kwargs)
- self.__logger.debug("PnfMacro init started")
+ super().__init__('pnf_macro', **kwargs)
self.test = PnfMacroScenarioStep(cleanup=settings.CLEANUP_FLAG)
def run(self):
--- /dev/null
+import logging
+
+from onapsdk.configuration import settings
+from xtesting.core import testcase
+
+
+class ScenarioBase(testcase.TestCase):
+ """Scenario base class."""
+
+ __logger = logging.getLogger()
+
+ def __init__(self, case_name_override, **kwargs):
+ """Init base scenario."""
+ if "case_name" not in kwargs:
+ kwargs["case_name"] = case_name_override
+ self.__logger.info("Global Configuration:")
+ for val in settings._settings:
+ self.__logger.info("%s: %s", val, settings._settings[val])
+ super().__init__(**kwargs)
+ self.__logger.debug("%s init started", kwargs["case_name"])
import logging
import time
-from xtesting.core import testcase
+
from onapsdk.configuration import settings
from onapsdk.exceptions import SDKException
-
+from onaptests.scenario.scenario_base import ScenarioBase
from onaptests.steps.cloud.check_status import CheckNamespaceStatusStep
from onaptests.utils.exceptions import OnapTestException
-class Status(testcase.TestCase):
+class Status(ScenarioBase):
"""Retrieve status of Kubernetes resources in the nemaspace."""
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
"""Init the testcase."""
- if "case_name" not in kwargs:
- kwargs["case_name"] = 'status'
- super().__init__(**kwargs)
- self.__logger.debug("Status check init started")
+ super().__init__('status', **kwargs)
self.test = CheckNamespaceStatusStep(
cleanup=settings.CLEANUP_FLAG)
self.start_time = None