diff options
author | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2021-03-23 18:23:48 +0000 |
---|---|---|
committer | morganrol <morgan.richomme@orange.com> | 2021-04-02 08:48:50 +0200 |
commit | 0a315a1b542a96d62fea12f49b353bca54464ee7 (patch) | |
tree | 9ec0f7d973c87e2aa79ec8db339b5fec07f76ddf /src/onaptests/steps/onboard | |
parent | 612848c7353ced7aa0f16ff90ad3afffa65e8aed (diff) |
Basic VM macro
Issue-ID: INT-1894
Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl>
Change-Id: Idd977cf3082587746fe27718a284197fda4afe5c
Diffstat (limited to 'src/onaptests/steps/onboard')
-rw-r--r-- | src/onaptests/steps/onboard/cds.py | 30 | ||||
-rw-r--r-- | src/onaptests/steps/onboard/vf.py | 11 |
2 files changed, 39 insertions, 2 deletions
diff --git a/src/onaptests/steps/onboard/cds.py b/src/onaptests/steps/onboard/cds.py index 6ee0ae1..73f298c 100644 --- a/src/onaptests/steps/onboard/cds.py +++ b/src/onaptests/steps/onboard/cds.py @@ -121,8 +121,8 @@ class CbaEnrichStep(CDSBaseStep): """ super().execute() blueprint: Blueprint = Blueprint.load_from_file(settings.CDS_CBA_UNENRICHED) - blueprint.enrich() - blueprint.save(settings.CDS_CBA_ENRICHED) + enriched: Blueprint = blueprint.enrich() + enriched.save(settings.CDS_CBA_ENRICHED) @BaseStep.store_state(cleanup=True) def cleanup(self) -> None: @@ -133,3 +133,29 @@ class CbaEnrichStep(CDSBaseStep): """ super().cleanup() Path(settings.CDS_CBA_ENRICHED).unlink() + + +class CbaPublishStep(CDSBaseStep): + """Publish CBA file step.""" + + def __init__(self, cleanup=False) -> None: + """Initialize CBA publish step.""" + super().__init__(cleanup=cleanup) + self.add_step(CbaEnrichStep(cleanup=cleanup)) + + @property + def description(self) -> str: + """Step description.""" + return "Publish CBA file." + + @BaseStep.store_state + def execute(self) -> None: + """Enrich CBA file. + + Use settings values: + - CDS_DD_FILE. + + """ + super().execute() + blueprint: Blueprint = Blueprint.load_from_file(settings.CDS_CBA_ENRICHED) + blueprint.publish() diff --git a/src/onaptests/steps/onboard/vf.py b/src/onaptests/steps/onboard/vf.py index 817b412..5f5fc4d 100644 --- a/src/onaptests/steps/onboard/vf.py +++ b/src/onaptests/steps/onboard/vf.py @@ -85,4 +85,15 @@ class YamlTemplateVfOnboardStep(YamlTemplateBaseStep): for vnf in self.yaml_template["vnfs"]: vsp: Vsp = Vsp(name=f"{vnf['vnf_name']}_VSP") vf: Vf = Vf(name=vnf['vnf_name'], vsp=vsp) + if all([x in vnf for x in ["vnf_artifact_type", + "vnf_artifact_name", + "vnf_artifact_label", + "vnf_artifact_file_path"]]): + vf.create() + vf.add_deployment_artifact( + artifact_type=vnf["vnf_artifact_type"], + artifact_name=vnf["vnf_artifact_name"], + artifact_label=vnf["vnf_artifact_label"], + artifact=vnf["vnf_artifact_file_path"] + ) vf.onboard() |