def test_vsp_create(): LICENSE_MODEL_ID = "license_model_id" LICENSE_MODEL_VERSION_ID = "license_model_version_id" FEATURE_GROUP_ID = "feature_group_id" LICENSE_AGREEMENT_ID = "license_agreement_id" LICENSE_MODEL_NAME = "test" VSP_MODEL_ID = "software_product_id" VSP_MODEL_VERSION_ID = "software_product_version_id" VSP_NAME = "software_product_name" mockup_catalog_item( license_model_client.catalog_items["GET_LICENSE_MODELS"], override_return_data={ "results": [{ "name": LICENSE_MODEL_NAME, "id": LICENSE_MODEL_ID }] }, ) mockup_catalog_item( license_model_client.catalog_items["GET_LICENSE_MODEL_VERSIONS"], override_return_data={ "results": [{ "name": LICENSE_MODEL_NAME, "id": LICENSE_MODEL_VERSION_ID }] }, ) mockup_catalog_item( license_model_client. catalog_items["GET_LICENSE_MODEL_VERSION_ATTRIBUTE"], override_return_data={ "results": [{ "name": LICENSE_MODEL_NAME, "id": FEATURE_GROUP_ID }] }, override_uri_params={"attribute": "feature-groups"}, ) mockup_catalog_item( license_model_client. catalog_items["GET_LICENSE_MODEL_VERSION_ATTRIBUTE"], override_return_data={ "results": [{ "name": LICENSE_MODEL_NAME, "id": LICENSE_AGREEMENT_ID }] }, override_uri_params={"attribute": "license-agreements"}, ) mockup_client(license_model_client) mockup_catalog_item( vsp_client.catalog_items["GET_SOFTWARE_PRODUCTS"], override_return_data={"results": []}, ) mockup_catalog_item( vsp_client.catalog_items["ADD_SOFTWARE_PRODUCT"], override_return_data={ "itemId": VSP_MODEL_ID, "version": { "id": VSP_MODEL_VERSION_ID }, }, ) mockup_catalog_item( vsp_client.catalog_items["GET_SOFTWARE_PRODUCT"], override_return_data={"name": VSP_NAME}, ) mockup_client(vsp_client) vsp = sdc.vsp.VSP( "vendor_name", LICENSE_MODEL_NAME, "{}/test.zip".format(THIS_DIR), "application/zip", VSP_NAME, "description", "category", "sub_category", contributers=["test123"], ) assert vsp.tosca == {"name": VSP_NAME}
def test_vnf_instance(): oc = Client() SERVICE_MODEL_NAME = "service_model_name" SERVICE_MODEL_ID = "service_model_id" SERVICE_MODEL_INVARIANT_ID = "service_model_invariant_id" SERVICE_INSTANCE_NAME = "service_instance_name" SERVICE_INSTANCE_ID = "service_instance_id" SERVICE_INSTANCE_INVARIANT_ID = "service_instance_invariant_id" SERVICE_INSTANCE_VERSION = "service_instance_version" SERVICE_INSTANCE_UUID = "service_instance_uuid" VNF_MODEL_NAME = "vnf_model_name" VNF_INSTANCE_NAME = "vnf_instance_name" VNF_CUSTOMIZATION_UUID = "vnf_customization_uuid" VNF_INVARIANT_ID = "vnf_invariant_id" VNF_ACTUAL_UUID = "vnf_actual_uuid" VNF_VERSION = "vnf_version" CLOUD_OWNER = "cloud_owner" CLOUD_REGION = "cloud_region" TENANT_NAME = "tenant_name" TENANT_ID = "tenant_id" REQUEST_ID = "request_id" mockup_catalog_item( oc.sdc.service.catalog_items["GET_SERVICES"], override_return_data={ "services": [ { "name": SERVICE_MODEL_NAME, "uniqueId": SERVICE_MODEL_ID, "lastUpdateDate": 123456, } ] }, ) mockup_catalog_item( oc.aai.cloud_infrastructure.catalog_items["GET_CLOUD_REGION_TENANTS"], override_uri_params={"cloud_owner": CLOUD_OWNER, "cloud_region": CLOUD_REGION}, override_return_data={ "tenant": [ { "tenant-name": TENANT_NAME, "tenant-id": TENANT_ID } ], } ) mockup_catalog_item( oc.sdc.service.catalog_items["GET_SDC_SERVICE"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, override_return_data={ "invariantUUID": SERVICE_MODEL_INVARIANT_ID, "uniqueId": SERVICE_MODEL_ID, "componentInstances": [ { "componentName": VNF_MODEL_NAME, "customizationUUID": VNF_CUSTOMIZATION_UUID, "actualComponentUid": VNF_ACTUAL_UUID, "componentVersion": VNF_VERSION } ] } ) mockup_catalog_item( oc.sdc.vnf.catalog_items["GET_CATALOG_RESOURCE"], override_return_data={ "invariantUUID": VNF_INVARIANT_ID }, override_uri_params={"catalog_resource_id": VNF_ACTUAL_UUID}, ) mockup_catalog_item( oc.sdnc.config.catalog_items["GET_SERVICE_INSTANCES"], override_return_data={ "services": { "service": [ { "service-data": { "service-request-input": { "service-instance-name": SERVICE_INSTANCE_NAME }, "service-information": { "onap-model-information": { "model-invariant-uuid": SERVICE_INSTANCE_INVARIANT_ID, "model-uuid": SERVICE_INSTANCE_UUID, "model-version": SERVICE_INSTANCE_VERSION, "model-name": SERVICE_MODEL_NAME, } } }, "service-instance-id": SERVICE_INSTANCE_ID } ] } }, ) mockup_catalog_item( oc.so.service_instantiation.catalog_items["CREATE_VNF_INSTANCE"], override_return_data={ "requestReferences": { "requestId": REQUEST_ID } } ) mockup_catalog_item( oc.so.service_instantiation.catalog_items["GET_REQUEST_STATUS"], override_uri_params={"request_id": REQUEST_ID}, override_return_data={ "request": { "requestStatus": { "requestState": "COMPLETE" } } } ) vnfi = VNFInstance( vnf_instance_name=VNF_INSTANCE_NAME, service_instance_name=SERVICE_INSTANCE_NAME, requestor_id="cs0008", model_name=VNF_MODEL_NAME, tenant_name=TENANT_NAME, cloud_owner=CLOUD_OWNER, cloud_region=CLOUD_REGION, api_type="GR_API", platform="platform", line_of_business="lob" ) vnfi.create() assert vnfi.vnf_instance_name == VNF_INSTANCE_NAME
def test_vnf_create(): oc = Client() VNF_NAME = "vnf_name" SERVICE_MODEL_ID = "service_model_id" VNF_RESOURCE_ID = "vnf_resource_id" SERVICE_NAME = "service_name" mockup_catalog_item( oc.sdc.service.catalog_items["GET_SERVICES"], override_return_data={"services": []}, ) mockup_catalog_item( oc.sdc.service.catalog_items["ADD_CATALOG_SERVICE"], override_return_data={"uniqueId": SERVICE_MODEL_ID}, ) mockup_catalog_item( oc.sdc.service.catalog_items["ADD_RESOURCE_INSTANCE"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, override_return_data={"uniqueId": VNF_RESOURCE_ID}, ) mockup_catalog_item( oc.sdc.service.catalog_items["CHECKIN_SERVICE"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, ) mockup_catalog_item( oc.sdc.service.catalog_items["REQUEST_SERVICE_CERTIFICATION"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, ) mockup_catalog_item( oc.sdc.service.catalog_items["START_SERVICE_CERTIFICATION"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, ) mockup_catalog_item( oc.sdc.service.catalog_items["FINISH_SERVICE_CERTIFICATION"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, override_return_data={"uniqueId": SERVICE_MODEL_ID}) mockup_catalog_item( oc.sdc.service.catalog_items["APPROVE_SERVICE_CERTIFICATION"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, ) mockup_catalog_item( oc.sdc.service.catalog_items["DISTRIBUTE_SDC_SERVICE"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, ) mockup_catalog_item( oc.sdc.service.catalog_items["GET_SDC_SERVICE"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, override_return_data={ "uniqueId": SERVICE_MODEL_ID, }) service = Service(instantiation_type="A-la-carte", service_name=SERVICE_NAME, contact_id="cs0008", category_name="Network L1-3", tag="robot", project_code="123456", environment_context="General_Revenue-Bearing", ecomp_generated_naming="true", description="This is a test", resources=[{ "resource_name": VNF_NAME, "resource_id": VNF_RESOURCE_ID, "catalog_resource_name": VNF_NAME, "origin_type": "VF", "properties": {} }], allow_update=False, wait_for_distribution=False) service.create() service._submit() assert service.service_name == SERVICE_NAME
def test_vnf_create(): SOFTWARE_PRODUCT_NAME = "software_product_name" SOFTWARE_PRODUCT_ID = "software_product_id" SOFTWARE_PRODUCT_VERSION_ID = "software_product_version_id" VNF_NAME = "vnf_name" RESOURCE_TYPE = "VF" CATALOG_RESOURCE_ID = "catalog_resource_id" return_data = { "uniqueId": CATALOG_RESOURCE_ID, "componentInstancesInputs": { "instance_id1": [ { "name": "vm_type_tag", "value": "red" }, { "name": "nf_role", "value": "dfankafd" }, ] }, "name": VNF_NAME, } mockup_catalog_item( vsp_client.catalog_items["GET_SOFTWARE_PRODUCTS"], override_return_data={ "results": [{ "name": SOFTWARE_PRODUCT_NAME, "id": SOFTWARE_PRODUCT_ID }] }, ) mockup_catalog_item( vsp_client.catalog_items["GET_SOFTWARE_PRODUCT_VERSIONS"], override_return_data={ "results": [{ "name": SOFTWARE_PRODUCT_NAME, "id": SOFTWARE_PRODUCT_VERSION_ID }] }, override_uri_params={"software_product_id": SOFTWARE_PRODUCT_ID}, ) mockup_catalog_item( vsp_client.catalog_items["GET_SOFTWARE_PRODUCT"], override_return_data={"vendorName": "vendor_name"}, override_uri_params={ "software_product_id": SOFTWARE_PRODUCT_ID, "software_product_version_id": SOFTWARE_PRODUCT_VERSION_ID, }, ) mockup_catalog_item( vnf_client.catalog_items["GET_RESOURCES"], override_return_data={"resources": []}, ) mockup_catalog_item( vnf_client.catalog_items["ADD_CATALOG_RESOURCE"], override_return_data=return_data, ) mockup_catalog_item( vnf_client.catalog_items["GET_CATALOG_RESOURCE"], override_return_data=return_data, override_uri_params={"catalog_resource_id": CATALOG_RESOURCE_ID}, ) mockup_catalog_item( vnf_client.catalog_items["CERTIFY_CATALOG_RESOURCE"], override_return_data=return_data, override_uri_params={"catalog_resource_id": CATALOG_RESOURCE_ID}, ) mockup_catalog_item( vnf_client.catalog_items["ADD_CATALOG_RESOURCE_PROPERTY"], override_uri_params={ "catalog_resource_id": CATALOG_RESOURCE_ID, "catalog_resource_instance_id": "instance_id1", }, ) mockup_client(vnf_client) vnf = VNF( SOFTWARE_PRODUCT_NAME, VNF_NAME, RESOURCE_TYPE, vm_types=[{ "vm_type": "red", "properties": { "nf_role": "blue" } }], ) vnf._submit() assert "catalog_resource_name" in vnf.tosca
def test_license_model_create(): LICENSE_MODEL_ID = "license_model_id" LICENSE_MODEL_VERSION_ID = "license_model_version_id" FEATURE_GROUP_ID = "feature_group_id" KEYGROUP_ID = "key_group_id" ENTITLEMENT_POOL_ID = "entitlement_pool_id" LICENSE_AGREEMENT_ID = "license_agreement_id" VENDOR_NAME = "vendor_name" ID = "id" DESCRIPTION = "description" mockup_catalog_item( license_model_client.catalog_items["ADD_LICENSE_MODEL"], override_return_data={ "itemId": LICENSE_MODEL_ID, "version": {"id": LICENSE_MODEL_VERSION_ID}, }, ) mockup_catalog_item( license_model_client.catalog_items["ADD_KEY_GROUP"], override_return_data={"value": KEYGROUP_ID}, override_uri_params={ "license_model_id": LICENSE_MODEL_ID, "license_model_version_id": LICENSE_MODEL_VERSION_ID, }, ) mockup_catalog_item( license_model_client.catalog_items["ADD_ENTITLEMENT_POOL"], override_return_data={"value": ENTITLEMENT_POOL_ID}, override_uri_params={ "license_model_id": LICENSE_MODEL_ID, "license_model_version_id": LICENSE_MODEL_VERSION_ID, }, ) mockup_catalog_item( license_model_client.catalog_items["ADD_FEATURE_GROUP"], override_return_data={"value": FEATURE_GROUP_ID}, override_uri_params={ "license_model_id": LICENSE_MODEL_ID, "license_model_version_id": LICENSE_MODEL_VERSION_ID, }, ) mockup_catalog_item( license_model_client.catalog_items["ADD_LICENSE_AGREEMENT"], override_return_data={"value": LICENSE_AGREEMENT_ID}, override_uri_params={ "license_model_id": LICENSE_MODEL_ID, "license_model_version_id": LICENSE_MODEL_VERSION_ID, }, ) return_data = {"vendorName": VENDOR_NAME, "id": ID, "description": DESCRIPTION} mockup_catalog_item( license_model_client.catalog_items["GET_LICENSE_MODEL"], override_return_data=return_data, override_uri_params={ "license_model_id": LICENSE_MODEL_ID, "license_model_version_id": LICENSE_MODEL_VERSION_ID, }, ) mockup_client(license_model_client) lm = LicenseModel( VENDOR_NAME, "abc123", "entitlement_pool_name", "key_group_name", "feature_group_name", "license_agreement_name", "license_start_date", "license_end_date", ) assert lm.tosca == return_data
def test_service_instance(): oc = Client() SERVICE_MODEL_NAME = "service_model" SERVICE_MODEL_ID = "service_model_id" SERVICE_MODEL_INVARIANT_ID = "service_model_invariant_id" SERVICE_INSTANCE_NAME = "SERVICE_INSTANCE_NAME" OWNING_ENTITY_NAME = "owning_entity" OWNING_ENTITY_ID = "owning_entity_id" CLOUD_OWNER = "cloud_owner" CLOUD_REGION = "cloud_region" TENANT_NAME = "tenant_name" TENANT_ID = "tenant_id" REQUEST_ID = "request_id" mockup_catalog_item( oc.sdc.service.catalog_items["GET_SERVICES"], override_return_data={ "services": [{ "name": SERVICE_MODEL_NAME, "uniqueId": SERVICE_MODEL_ID, "lastUpdateDate": 123456 }] }, ) mockup_catalog_item( oc.sdc.service.catalog_items["GET_SDC_SERVICE"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, override_return_data={ "invariantUUID": SERVICE_MODEL_INVARIANT_ID, "uniqueId": SERVICE_MODEL_ID }) mockup_catalog_item( oc.aai.cloud_infrastructure.catalog_items["GET_CLOUD_REGION_TENANTS"], override_uri_params={ "cloud_owner": CLOUD_OWNER, "cloud_region": CLOUD_REGION }, override_return_data={ "tenant": [{ "tenant-name": TENANT_NAME, "tenant-id": TENANT_ID }], }) mockup_catalog_item( oc.vid.maintenance.catalog_items["GET_CATEGORY_PARAMETERS"], override_return_data={ "categoryParameters": { "owningEntity": [{ "name": OWNING_ENTITY_NAME, "id": OWNING_ENTITY_ID }] }, }) mockup_catalog_item( oc.so.service_instantiation.catalog_items["CREATE_SERVICE_INSTANCE"], override_return_data={"requestReferences": { "requestId": REQUEST_ID }}) mockup_catalog_item( oc.so.service_instantiation.catalog_items["GET_REQUEST_STATUS"], override_uri_params={"request_id": REQUEST_ID}, override_return_data={ "request": { "requestStatus": { "requestState": "COMPLETE" } } }) si = ServiceInstance(service_instance_name=SERVICE_INSTANCE_NAME, requestor_id="cs0008", model_name=SERVICE_MODEL_NAME, model_version="1.0", tenant_name=TENANT_NAME, cloud_owner=CLOUD_OWNER, cloud_region=CLOUD_REGION, api_type="GR_API", service_type="ONAPSERVICE", customer_name="ONAPCUSTOMER", project_name="ONAPPROJECT", owning_entity_name=OWNING_ENTITY_NAME) si.create() assert si.service_instance_name == SERVICE_INSTANCE_NAME
def test_vnf_create(): oc = Client() SOFTWARE_PRODUCT_NAME = "software_product_name" SOFTWARE_PRODUCT_ID = "software_product_id" SOFTWARE_PRODUCT_VERSION_ID = "software_product_version_id" VNF_NAME = "vnf_name" RESOURCE_TYPE = "VF" CATALOG_RESOURCE_ID = "catalog_resource_id" return_data = { "uniqueId": CATALOG_RESOURCE_ID, "componentInstancesInputs": { "instance_id1": [ { "name": "vm_type_tag", "value": "red" }, { "name": "nf_role", "value": "dfankafd" }, ] }, "name": VNF_NAME, } mockup_catalog_item( oc.sdc.vsp.catalog_items["GET_SOFTWARE_PRODUCTS"], override_return_data={ "results": [{ "name": SOFTWARE_PRODUCT_NAME, "id": SOFTWARE_PRODUCT_ID }] }, ) mockup_catalog_item( oc.sdc.vsp.catalog_items["GET_SOFTWARE_PRODUCT_VERSIONS"], override_return_data={ "results": [{ "name": SOFTWARE_PRODUCT_NAME, "id": SOFTWARE_PRODUCT_VERSION_ID }] }, override_uri_params={"software_product_id": SOFTWARE_PRODUCT_ID}, ) mockup_catalog_item( oc.sdc.vsp.catalog_items["GET_SOFTWARE_PRODUCT"], override_return_data={ "vendorName": "vendor_name", "category": "resourceNewCategory.application l4+", "subCategory": "resourceNewCategory.application l4+.web server", }, override_uri_params={ "software_product_id": SOFTWARE_PRODUCT_ID, "software_product_version_id": SOFTWARE_PRODUCT_VERSION_ID, }, ) mockup_catalog_item( oc.sdc.vnf.catalog_items["GET_RESOURCES"], override_return_data={"resources": []}, ) mockup_catalog_item( oc.sdc.vnf.catalog_items["ADD_CATALOG_RESOURCE"], override_return_data=return_data, ) mockup_catalog_item( oc.sdc.vnf.catalog_items["GET_CATALOG_RESOURCE"], override_return_data=return_data, override_uri_params={"catalog_resource_id": CATALOG_RESOURCE_ID}, ) mockup_catalog_item( oc.sdc.vnf.catalog_items["CERTIFY_CATALOG_RESOURCE"], override_return_data=return_data, override_uri_params={"catalog_resource_id": CATALOG_RESOURCE_ID}, ) mockup_catalog_item( oc.sdc.vnf.catalog_items["ADD_CATALOG_RESOURCE_PROPERTY"], override_uri_params={ "catalog_resource_id": CATALOG_RESOURCE_ID, "catalog_resource_instance_id": "instance_id1", }, ) mockup_catalog_item( oc.sdc.catalog_items["GET_RESOURCE_CATEGORIES"], override_return_data=[{ "name": "Application L4+", "normalizedName": "application l4+", "uniqueId": "resourceNewCategory.application l4+", "icons": False, "subcategories": [{ "name": "Call Control", "normalizedName": "call control", "uniqueId": "resourceNewCategory.application l4+.call control", "icons": ["call_controll"], "groupings": False, "version": False, "ownerId": False, "empty": False, "type": False }] }], ) vnf = VNF( software_product_name=SOFTWARE_PRODUCT_NAME, vnf_name=VNF_NAME, resource_type=RESOURCE_TYPE, vm_types=[{ "vm_type": "red", "properties": { "nf_role": "blue" } }], ) vnf.create() vnf._submit() assert "componentInstancesInputs" in vnf.tosca
def test_module_instance(): oc = Client() SERVICE_MODEL_NAME = "service_model_name" SERVICE_MODEL_ID = "service_model_id" SERVICE_MODEL_INVARIANT_ID = "service_model_invariant_id" SERVICE_INSTANCE_NAME = "service_instance_name" SERVICE_INSTANCE_ID = "service_instance_id" SERVICE_INSTANCE_INVARIANT_ID = "service_instance_invariant_id" SERVICE_INSTANCE_VERSION = "service_instance_version" SERVICE_INSTANCE_UUID = "service_instance_uuid" VNF_MODEL_NAME = "vnf_model_name" VNF_INSTANCE_NAME = "vnf_instance_name" VNF_INSTANCE_ID = "vnf_instance_id" VNF_CUSTOMIZATION_UUID = "vnf_customization_uuid" VNF_INVARIANT_ID = "vnf_invariant_id" VNF_ACTUAL_UUID = "vnf_actual_uuid" VNF_VERSION = "vnf_version" HEAT_TEMPLATE_NAME = "base.yaml" HEAT_TEMPLATE_ARTIFACT_UUID = "heat_template_artifact_uuid" MODULE_MODEL_INVARIANT_UUID = "module_model_invariant_uuid" MODULE_MODEL_VERSION_ID = "module_model_version_id" MODULE_MODEL_CUSTOMIZATION_ID = "module_model_customization_id" MODULE_MODEL_NAME = "module_model_name" MODULE_MODEL_VERSION = "module_model_version" MODULE_INSTANCE_NAME = "module_instance_name" CLOUD_OWNER = "cloud_owner" CLOUD_REGION = "cloud_region" TENANT_NAME = "tenant_name" TENANT_ID = "tenant_id" REQUEST_ID = "request_id" mockup_catalog_item( oc.sdc.service.catalog_items["GET_SERVICES"], override_return_data={ "services": [{ "name": SERVICE_MODEL_NAME, "uniqueId": SERVICE_MODEL_ID, "lastUpdateDate": 123456, }] }, ) mockup_catalog_item( oc.aai.cloud_infrastructure.catalog_items["GET_CLOUD_REGION_TENANTS"], override_uri_params={ "cloud_owner": CLOUD_OWNER, "cloud_region": CLOUD_REGION }, override_return_data={ "tenant": [{ "tenant-name": TENANT_NAME, "tenant-id": TENANT_ID }], }) mockup_catalog_item( oc.sdc.service.catalog_items["GET_SDC_SERVICE"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, override_return_data={ "invariantUUID": SERVICE_MODEL_INVARIANT_ID, "uniqueId": SERVICE_MODEL_ID, "componentInstances": [{ "componentName": VNF_MODEL_NAME, "customizationUUID": VNF_CUSTOMIZATION_UUID, "actualComponentUid": VNF_ACTUAL_UUID, "componentVersion": VNF_VERSION, "deploymentArtifacts": { "heat1": { "artifactName": HEAT_TEMPLATE_NAME, "artifactUUID": HEAT_TEMPLATE_ARTIFACT_UUID } }, "groupInstances": [{ "artifactsUuid": [HEAT_TEMPLATE_ARTIFACT_UUID], "invariantUUID": MODULE_MODEL_INVARIANT_UUID, "groupUUID": MODULE_MODEL_VERSION_ID, "customizationUUID": MODULE_MODEL_CUSTOMIZATION_ID, "groupName": MODULE_MODEL_NAME, "version": MODULE_MODEL_VERSION }] }] }) mockup_catalog_item( oc.sdc.vnf.catalog_items["GET_CATALOG_RESOURCE"], override_return_data={"invariantUUID": VNF_INVARIANT_ID}, override_uri_params={"catalog_resource_id": VNF_ACTUAL_UUID}, ) mockup_catalog_item(oc.sdnc.operations.catalog_items["GR_API_PRELOAD"], ) mockup_catalog_item( oc.sdnc.config.catalog_items["GET_SERVICE_INSTANCES"], override_return_data={ "services": { "service": [{ "service-data": { "service-request-input": { "service-instance-name": SERVICE_INSTANCE_NAME }, "service-information": { "onap-model-information": { "model-invariant-uuid": SERVICE_INSTANCE_INVARIANT_ID, "model-uuid": SERVICE_INSTANCE_UUID, "model-version": SERVICE_INSTANCE_VERSION, "model-name": SERVICE_MODEL_NAME, } }, "vnfs": { "vnf": [{ "vnf-data": { "vnf-information": { "vnf-name": VNF_INSTANCE_NAME, "vnf-id": VNF_INSTANCE_ID, "onap-model-information": { "model-name": VNF_MODEL_NAME, "model-invariant-uuid": VNF_INVARIANT_ID, "model-uuid": VNF_ACTUAL_UUID, "model-customization-uuid": VNF_CUSTOMIZATION_UUID, "model-version": "1.0" } } } }] } }, "service-instance-id": SERVICE_INSTANCE_ID }] } }, ) mockup_catalog_item( oc.so.service_instantiation.catalog_items["CREATE_MODULE_INSTANCE"], override_return_data={"requestReferences": { "requestId": REQUEST_ID }}) mockup_catalog_item( oc.so.service_instantiation.catalog_items["GET_REQUEST_STATUS"], override_uri_params={"request_id": REQUEST_ID}, override_return_data={ "request": { "requestStatus": { "requestState": "COMPLETE" } } }) mi = ModuleInstance(module_instance_name=MODULE_INSTANCE_NAME, vnf_instance_name=VNF_INSTANCE_NAME, service_instance_name=SERVICE_INSTANCE_NAME, requestor_id="cs0008", heat_template_name=HEAT_TEMPLATE_NAME, preload_path="{}/base_preload.json".format(THIS_DIR), tenant_name=TENANT_NAME, cloud_owner=CLOUD_OWNER, cloud_region=CLOUD_REGION, api_type="GR_API") mi.create() assert mi.module_instance_name == MODULE_INSTANCE_NAME