xtesting==0.91.0
avionix>=0.4.5
openstacksdk>=0.61.0
-onapsdk==10.4.1
+onapsdk==10.4.2
jinja2>3
kubernetes>=22.6.0
cleanup=settings.CLEANUP_FLAG)
try:
basic_vm_onboard.execute()
+ basic_vm_onboard.cleanup()
except onap_test_exceptions.TestConfigurationException:
logger.error("Basic Onboard configuration error")
basic_vm_onboard.reports_collection.generate_report()
#CLEANUP_ACTIVITY_TIMER = 10 # nb of seconds before cleanup in case cleanup option is set
VENDOR_NAME = "basic_onboard_vendor"
-VF_NAME = "basic_onboard_vf"
-VSP_NAME = "basic_onboard_vsp"
-
MODEL_YAML_TEMPLATE = None
+CLEANUP_FLAG = True
+SDC_CLEANUP = True
}
}
CLEANUP_FLAG = False
+# Additional flag to enable SDC resources cleanup
+# Added as SDC's VSP deletion is broken and most tests fail due to that
+# Should be removed as soon as SDC resource deletion is fixed
+SDC_CLEANUP = False
REPORTING_FILE_PATH = "/tmp/reporting.html"
K8S_REGION_TYPE = "k8s"
self.__logger.debug("start time")
try:
self.test.execute()
+ self.test.cleanup()
self.__logger.info("VNF basic_vm successfully onboarded")
self.result = 100
except OnapTestException as exc:
)
pnf.onboard()
+ @BaseStep.store_state(cleanup=True)
+ def cleanup(self):
+ pnf: Pnf = Pnf(name=settings.PNF_NAME)
+ pnf.delete()
+ super().cleanup()
+
class YamlTemplatePnfOnboardStep(YamlTemplateBaseStep):
"""PNF onboard using YAML template step."""
artifact=pnf["pnf_artifact_file_path"]
)
pnf_obj.onboard()
+
+ @YamlTemplateBaseStep.store_state(cleanup=True)
+ def cleanup(self):
+ if "pnfs" in self.yaml_template:
+ for pnf in self.yaml_template["pnfs"]:
+ pnf_obj: Pnf = Pnf(name=pnf["pnf_name"])
+ pnf_obj.delete()
+ super().cleanup()
service.checkin()
service.onboard()
+ @BaseStep.store_state
+ def cleanup(self) -> None:
+ """Cleanup service onboard step."""
+ service: Service = Service(name=settings.SERVICE_NAME)
+ service.delete()
+ super().cleanup()
+
class YamlTemplateServiceOnboardStep(YamlTemplateBaseStep):
"""Service onboard using YAML template step."""
for property_name, property_value in component_properties.items():
prop: ComponentProperty = component.get_property(property_name)
prop.value = property_value
+
+ @YamlTemplateBaseStep.store_state(cleanup=True)
+ def cleanup(self) -> None:
+ """Cleanup service onboard step."""
+ service: Service = Service(name=self.service_name)
+ service.delete()
+ super().cleanup()
super().execute()
vendor: Vendor = Vendor(name=settings.VENDOR_NAME)
vendor.onboard()
+
+ @BaseStep.store_state(cleanup=True)
+ def cleanup(self) -> None:
+ vendor: Vendor = Vendor(name=settings.VENDOR_NAME)
+ vendor.archive()
+ vendor.delete()
+ super().cleanup()
if not vf.created():
vf.onboard()
+ @BaseStep.store_state(cleanup=True)
+ def cleanup(self):
+ vf: Vf = Vf(name=settings.VF_NAME)
+ vf.delete()
+ super().cleanup()
+
class YamlTemplateVfOnboardStep(YamlTemplateBaseStep):
"""Vf onboard using YAML template step."""
)
time.sleep(10)
vf.onboard()
+
+ @YamlTemplateBaseStep.store_state(cleanup=True)
+ def cleanup(self):
+ if "vnfs" in self.yaml_template:
+ for vnf in self.yaml_template["vnfs"]:
+ vf_obj: Vf = Vf(name=vnf["vnf_name"])
+ vf_obj.delete()
+ super().cleanup()
vsp: Vsp = Vsp(name=settings.VSP_NAME, vendor=vendor, package=open(settings.VSP_FILE_PATH, "rb"))
vsp.onboard()
+ @BaseStep.store_state(cleanup=True)
+ def cleanup(self):
+ vsp: Vsp = Vsp(name=settings.VSP_NAME)
+ vsp.archive()
+ vsp.delete()
+ super().cleanup()
+
class YamlTemplateVspOnboardStep(YamlTemplateBaseStep):
"""Vsp onboard using YAML template step."""
vendor=vendor,
package=package)
vsp.onboard()
+
+ @YamlTemplateBaseStep.store_state(cleanup=True)
+ def cleanup(self) -> None:
+ if "vnfs" in self.yaml_template:
+ for vnf in self.yaml_template["vnfs"]:
+ vsp: Vsp = Vsp(name=f"{vnf['vnf_name']}_VSP")
+ vsp.archive()
+ vsp.delete()
+ elif "pnfs" in self.yaml_template:
+ for pnf in self.yaml_template["pnfs"]:
+ vsp: Vsp = Vsp(name=f"{pnf['pnf_name']}_VSP")
+ vsp.archive()
+ vsp.delete()
+ super().cleanup()