1 """Instantiate basic vm using SO macro flow."""
2 from onapsdk.configuration import settings
3 from yaml import SafeLoader, load
5 from onaptests.scenario.scenario_base import (BaseStep, ScenarioBase,
6 YamlTemplateBaseScenarioStep)
7 from onaptests.steps.instantiate.service_macro import \
8 YamlTemplateServiceMacroInstantiateStep
9 from onaptests.steps.onboard.cds import CbaPublishStep
12 class BasicVmMacroStep(YamlTemplateBaseScenarioStep):
13 """Main basic vm macro scenario step."""
20 - YamlTemplateServiceMacroInstantiateStep.
22 super().__init__(cleanup=BaseStep.HAS_NO_CLEANUP)
23 self._yaml_template: dict = None
24 self.add_step(CbaPublishStep())
25 self.add_step(YamlTemplateServiceMacroInstantiateStep())
28 def description(self) -> str:
37 return "Basic VM macro scenario step"
40 def component(self) -> str:
43 Name of component which step is related with.
44 Most is the name of ONAP component.
50 return "PythonSDK-tests"
53 def yaml_template(self) -> dict:
54 """YAML template abstract property.
56 Every YAML template step need to implement that property.
62 if not self._yaml_template:
63 with open(settings.SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template:
64 self._yaml_template: dict = load(yaml_template, SafeLoader)
65 return self._yaml_template
68 def model_yaml_template(self) -> dict:
72 def service_instance_name(self) -> str:
73 """Service instance name.
76 str: Service instance name
79 return settings.SERVICE_INSTANCE_NAME
82 class BasicVmMacro(ScenarioBase):
83 """Instantiate a basic vm macro."""
85 def __init__(self, **kwargs):
86 """Init Basic Macro use case."""
87 super().__init__('basic_vm_macro', **kwargs)
88 self.test = BasicVmMacroStep()