diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot index cca928c20d04bffee93d88854ceaf5fd547c70d0..cca0474cbb4e2e22e81136c5a091dd389584a8c9 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot @@ -35,6 +35,7 @@ Get Information about an individual VNF Instance GET individual vnfInstance Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is vnfInstance + Check HTTP Response Body vnfInstance content against VNF Descriptor PUT Individual VNFInstance - Method not implemented [Documentation] Test ID: 7.3.1.2.3 diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot b/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot index 5722c62a9dda13487bd62338fc3fa5334ce8857d..85bc89adc46f71cb9563bc30cd8a1c7b5cdf4433 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot @@ -30,6 +30,7 @@ Get Individual VNF LCM Operation occurrences Get Individual VNF LCM Operation occurrences Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is VnfLcmOpOcc + Check HTTP Response Body of Individual VNF LCM Operation occurrences content against VNF Descriptor PUT Individual VNF LCM Operation occurrences - Method not implemented [Documentation] Test ID: 7.3.1.12.3 diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index f01d3b2d942b2fb8a20fba412bf67faa43e0983b..bcd2ed4dbc925a2d1f2cc9eeb528303090ebcb5a 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -8,6 +8,8 @@ Library BuiltIn Library JSONLibrary Library Collections Library JSONSchemaLibrary schemas/ +Variables descriptors/SOL001/VNFD/vnfd_SOL001.yaml +Variables descriptors/SOL006/VNFD/vnfd_SOL006.yaml *** Keywords *** Get Vnf Instance @@ -123,7 +125,9 @@ Send VNF Instance Resource Create Request Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/createVnfRequest.json + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File + ${template}= Get File jsons/createVnfRequest.json + ${body}= Format String ${template} vnfdId=${Descriptor_ID} vnfProvider=${Provider} vnfProductName=${Product_Name} vnfSoftwareVersion=${Software_Version} vnfdVersion= ${Descriptor_Version} flavourId=${Flavour_ID} ${response}= Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances ${body} Send VNF Instance Resource Delete Request @@ -322,11 +326,13 @@ POST Change VNF deployment flavour Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File ${template}= Get File jsons/changeVnfFlavourRequest.json - ${body}= Format String ${template} newFlavourId=${newFlavourId} + ${body}= Format String ${template} newFlavourId=${Flavour_ID} Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} ${outputResponse}= Output response - Set Global Variable ${response} ${outputResponse} + Set Global Variable ${response} ${outputResponse} + GET Change VNF deployment flavour log Trying to perform a GET. This method should not be implemented Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} @@ -360,8 +366,9 @@ POST Create a new vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File ${template}= Get File jsons/createVnfRequest.json - ${body}= Format String ${template} vnfdId=${vnfdId} + ${body}= Format String ${template} vnfdId=${Descriptor_ID} vnfProvider=${Provider} vnfProductName=${Product_Name} vnfSoftwareVersion=${Software_Version} vnfdVersion= ${Descriptor_Version} Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} @@ -491,10 +498,13 @@ PATCH individual vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/patchBodyRequest.json + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File + ${template}= Get File jsons/patchBodyRequest.json + ${body}= Format String ${template} vnfdId=${Descriptor_ID} vnfdVersion= ${Descriptor_Version} Patch ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${vnfInstanceId} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} + DELETE individual vnfInstance log Trying to delete an individual VNF instance Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} @@ -1180,3 +1190,160 @@ GET test endpoint Check HTTP Response Header Contain Link ${linkURL}= Get Value From Json ${response['headers']} $..Link Should Not Be Empty ${linkURL} + +Check HTTP Response Body vnfInstance content against VNF Descriptor + Run Keyword If ${check_descriptors} == 1 Check Individual VNF Instance Content + +Check Individual VNF Instance Content + PARSE the Descriptor File + Match the VNF Instance Response Attributes with Descriptors + +PARSE the Descriptor File + Run Keyword If '${descriptorType}'=='SOL001' Fetch Information from SOL001 descriptor file ELSE Fetch Information from SOL006 descriptor file + +Fetch Information from SOL001 descriptor file + @{VDU_labels}= Create List + @{VNF_labels}= Create List + @{VirtualLink_labels}= Create List + @{CP_labels}= Create List + @{Storage_labels}= Create List + FOR ${key} IN @{topology_template.node_templates.keys()} + ${key_type}= Get Variable Value ${topology_template.node_templates.${key}.type} + ${VDU_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_VDU_compute} + ${VNF_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_VNF} + ${Link_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_virtual_link} + ${VDUcp_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_VDU_cp} + ${Storage_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_storage} + Run Keyword If ${VDU_check} Append To List ${VDU_labels} ${key} + Run Keyword If ${VNF_check} Append To List ${VNF_labels} ${key} + Run Keyword If ${VNF_check} Get VNF Attributes from SOL001 ${key} + Run Keyword If ${Link_check} Append To List ${VirtualLink_labels} ${key} + Run Keyword If ${VDUcp_check} Append To List ${CP_labels} ${key} + Run Keyword If ${Storage_check} Append To List ${Storage_labels} ${key} + END + Set Global Variable @{VDU_IDs} @{VDU_labels} + Set Global Variable @{VNF_IDs} @{VNF_labels} + Set Global Variable @{VirtualLink_IDs} @{VirtualLink_labels} + Set Global Variable @{CP_IDs} @{CP_labels} + Set Global Variable @{Storage_IDs} @{Storage_labels} + +Get VNF Attributes from SOL001 + [Arguments] ${VNF_label} + ${descriptor_id}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.descriptor_id} + ${provider}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.provider} + ${product_name}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.product_name} + ${software_version}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.software_version} + ${descriptor_version}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.descriptor_version} + ${flavour_id}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.flavour_id} + + Set Global Variable ${Descriptor_ID} ${descriptor_id} + Set Global Variable ${Provider} ${provider} + Set Global Variable ${Product_Name} ${product_name} + Set Global Variable ${Software_Version} ${software_version} + Set Global Variable ${Descriptor_Version} ${descriptor_version} + Set Global Variable ${Flavour_ID} ${flavour_id} + + +Fetch Information from SOL006 descriptor file + ${descriptor_id}= Get Variable Value ${nfv.vnfd[0].id} + ${provider}= Get Variable Value ${nfv.vnfd[0].provider} + ${product_name}= Get Variable Value ${nfv.vnfd[0]['product-name']} + ${software_version}= Get Variable Value ${nfv.vnfd[0]['software-version']} + ${descriptor_version}= Get Variable Value ${nfv.vnfd[0].version} + ${VDUcount}= Get Length ${nfv.vnfd[0].vdu} + ${extCP_count}= Get Length ${nfv.vnfd[0]['ext-cpd']} + ${virtualLink_count}= Get length ${nfv.vnfd[0]['int-virtual-link-desc']} + ${instantiation_levels}= Get Length ${nfv.vnfd[0].df['instantiation-level']} + FOR ${key} IN @{nfv.vnfd[0].keys()} + ${VDU_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} vdu + Run Keyword If ${VDU_check} Get VDU IDs ${VDUcount} + ${extCP_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} ext-cpd + Run Keyword If ${extCP_check} Get External CP IDs ${extCP_count} + ${virtualLink_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} int-virtual-link-desc + Run Keyword If ${virtualLink_check} Get Virtual Link IDs ${virtualLink_count} + ${DF_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} df + Run Keyword If ${DF_check} Get Instantiation Levels ${instantiation_levels} + END + Set Global Variable ${Descriptor_ID} ${descriptor_id} + Set Global Variable ${Provider} ${provider} + Set Global Variable ${Product_Name} ${product_name} + Set Global Variable ${Software_Version} ${software_version} + Set Global Variable ${Descriptor_Version} ${descriptor_version} + +Get VDU IDs + [Arguments] ${count} + @{VDU_labels}= Create List + ${Storage_labels}= Create List + FOR ${i} IN RANGE ${count} + Append To List ${VDU_labels} ${nfv.vnfd[0].vdu[${i}]['id']} + Append To List ${Storage_labels} ${nfv.vnfd[0].vdu[${i}]['virtual-storage-desc']} + Get Internal CPs for each VDU ${i} + END + Set Global Variable ${VDU_IDs} ${VDU_labels} + Set Global Variable ${Storage_IDs} ${Storage_labels} + +Get Internal CPs for each VDU + [Arguments] ${vdu} + ${count}= Get Length ${nfv.vnfd[0].vdu[${vdu}]['int-cpd']} + ${internal_CPs}= Create List + FOR ${i} IN RANGE ${count} + Append To List ${internal_CPs} ${nfv.vnfd[0].vdu[${vdu}]['int-cpd'][${i}]['id']} + END + Set Global Variable ${internalCP_IDs} ${internal_CPs} + +Get External CP IDs + [Arguments] ${count} + @{external_CPs}= Create List + FOR ${i} IN RANGE ${count} + Append To List ${external_CPs} ${nfv.vnfd[0].ext_cpd[${i}].id} + END + Set Global Variable ${externalCP_IDs} ${external_CPs} + +Get Virtual Link IDs + [Arguments] ${count} + ${VirtualLink_labels}= Create List + FOR ${i} IN RANGE ${count} + Append To List ${VirtualLink_labels} ${nfv.vnfd[0]['int-virtual-link-desc'][${i}]['id']} + END + Set Global Variable ${VirtualLink_IDs} ${VirtualLink_labels} + +Get Instantiation Levels + [Arguments] ${count} + @{Instantiation_Levels}= Create List + FOR ${i} IN RANGE ${count} + Append To List ${Instantiation_Levels} ${nfv.vnfd[0].df['instantiation-level'][${i}]['id']} + END + Set Global Variable ${InstantiationLevel_IDs} ${Instantiation_Levels} + +Match the VNF Instance Response Attributes with Descriptors + #Checking Response attributes with VNF Descriptors + Should Be Equal As Strings ${response['body']['vnfdId']} ${Descriptor_ID} + Should Be Equal As Strings ${response['body']['vnfProvider']} ${Provider} + Should Be Equal As Strings ${response['body']['vnfProductName']} ${Product_Name} + Should Be Equal As Strings ${response['body']['vnfSoftwareVersion']} ${Software_Version} + Should Be Equal As Strings ${response['body']['vnfdVersion']} ${Descriptor_Version} + Should Be Equal As Strings ${response['body']['instantiatedVnfInfo']['flavourId']} ${Flavour_ID} + List Should Contain Value ${VDU_IDs} ${response['body']['instantiatedVnfInfo']['vnfcResourceInfo']['vduId']} + Run Keyword If '${descriptorType}'=='SOL006' List Should Contain Value ${externalCP_IDs} ${response['body']['instantiatedVnfInfo']['extCpInfo'][0]['cpdId']} + Run Keyword If '${descriptorType}'=='SOL006' List Should Contain Value ${internalCP_IDs} ${response['body']['instantiatedVnfInfo']['vnfcResourceInfo'][0]['vnfcCpInfo'][0]['cpdId']} + Run Keyword If '${descriptorType}'=='SOL001' List Should Contain Value @{CP_IDs} ${response['body']['instantiatedVnfInfo']['extCpInfo'][0]['cpdId']} + Run Keyword If '${descriptorType}'=='SOL001' List Should Contain Value @{CP_IDs} ${response['body']['instantiatedVnfInfo']['vnfcResourceInfo'][0]['vnfcCpInfo'][0]['cpdId']} + List Should Contain value ${Storage_IDs} ${response['body']['instantiatedVnfInfo']['virtualStorageResourceInfo'][0]['virtualStorageDescId']} + List Should Contain Value ${VirtualLink_IDs} ${response['body']['instantiatedVnfInfo']['extManagedVirtualLinkInfo'][0]['vnfVirtualLinkDescId']} + +Check HTTP Response Body of Individual VNF LCM Operation occurrences content against VNF Descriptor + Run Keyword If ${check_descriptors} == 1 Check Individual VNF LCM Operation Occurence Content + +Check Individual VNF LCM Operation Occurence Content + PARSE the Descriptor File + Match the VNF LCM Operation Occurence Response Attributes with Descriptors + +Match the VNF LCM Operation Occurence Response Attributes with Descriptors + #Checking Response attributes with VNF Descriptors + Should Be Equal As Strings ${response['body']['changedInfo']['vnfdId']} ${Descriptor_ID} + Should Be Equal As Strings ${response['body']['changedInfo']['vnfdVersion']} ${Descriptor_Version} + List Should Contain Value ${VDU_IDs} ${response['body']['resourceChanges']['affectedVnfcs'][0]['vduId']} + List Should Contain value ${Storage_IDs} ${response['body']['resourceChanges']['affectedVirtualStorages'][0]['virtualStorageDescId']} + List Should Contain Value ${VirtualLink_IDs} ${response['body']['resourceChanges']['affectedVirtualLinks'][0]['virtualStorageDescId']} + + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml b/SOL003/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e9159106a9469826fc1afbdc1bcba43ebc86f61a --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -0,0 +1,168 @@ +tosca_definitions_version: tosca_simple_yaml_1_2 +description: "TST010 reference VNF-B" +metadata: + descriptor_id: "VNF-B" + vendor: "ETSI TST WG" + version: "2.0" +topology_template: + substitution_mappings: + node_type: "tosca.nodes.nfv.VNF" + requirements: + virtual_link_management: + [management, virtual_link_management] + virtual_link_left: + [left, virtual_link_left] + virtual_link_right: + [right, virtual_link_right] + node_templates: + right: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 1 + requirements: + virtual_link_right: + virtual_binding: VDU-B-2 + management: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 0 + requirements: + virtual_link_management: + virtual_binding: VDU-B-1 + left: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 2 + requirements: + virtual_link_left: + virtual_binding: VDU-B-1 + internal_vl: + type: "tosca.nodes.nfv.VnfVirtualLink" + properties: + connectivity_type: + layer_protocols: [ ipv4 ] + description: Internal Virtual link in the VNF + vl_profile: + max_bitrate_requirements: + root: 100000 + leaf: 20000 + min_bitrate_requirements: + root: 10000 + leaf: 10000 + internal_vdu_b_1_cp: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 2 + requirements: + - virtual_binding: VDU-B-1 + - virtual_link: internal_vl + internal_vdu_b_2_cp: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 0 + requirements: + - virtual_binding: VDU-B-2 + - virtual_link: internal_vl + vdu_b_1_vsd: + type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage" + properties: + virtual_block_storage_data: + size_of_storage: 20 + rdma_enabled: false + sw_image_data: + name: "vdu-b-1 image" + version: "1.1" + checksum: + algorithm: "sha-224" + hash: "somehashfortst010" + container_format: "bare" + disk-format: qcow2 + min-disk: '1' + min-ram: '2' + size: '1' + artifacts: + sw_image: + type: "tosca.artifacts.nfv.SwImage" + file: vdu-b-1.qcow2 + vdu_b_2_vsd: + type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage" + properties: + virtual_block_storage_data: + size_of_storage: 20 + rdma_enabled: false + sw_image_data: + name: "vdu-b-2 image" + version: "1.1" + checksum: + algorithm: "sha-224" + hash: "somehashfortst010" + container_format: "bare" + disk-format: qcow2 + min-disk: '1' + min-ram: '2' + size: '1' + artifacts: + sw_image: + type: tosca.artifacts.nfv.SwImage + file: vdu-b-2.qcow2 + vnf_b_1_VNF: + type: "tosca.nodes.nfv.VNF" + properties: + descriptor_id: "VNF-B-2VDUs" + descriptor_version: "2.0" + provider: "ETSI TST WG" + product_name: "VNF-B-2VDUs" + software_version: "2.0" + product_info_name: "VNF-B-2VDUs" + product_info_description: "TST010 reference VNF-B with 2 VDUs" + flavour_id: "VNF-B-2VDU_flavor" + flavour_description: "VNF-B with 2 VDUs flavor" + vnfm_info: + etsivnfm: + - v2.3.1 + interfaces: + Vnflcm: + scale: + implementation: scale-example.yaml + terminate: + implementation: terminate-example.yaml + operate: + implementation: operate-example.yaml + VDU_B_1: + type: "tosca.nodes.nfv.Vdu.Compute" + properties: + name: "vdu-b-1-vcd" + descriptor: "Description of VDU-B-1" + vdu_profile: + min_number_of_instances: 1 + max_number_of_instances: 2 + capabilities: + virtual_compute: + properties: + virtual_memory: + virtual_mem_size: 4096 + numa_enabled: false + virtual_cpu: + num_virtual_cpu: 2 + requirements: + virtual_storage: + - "vdu-b-1-vsd" + VDU_B_2: + type: "tosca.nodes.nfv.Vdu.Compute" + properties: + name: "vdu-b-2-vcd" + descriptor: "Description of VDU-B-2" + vdu_profile: + min_number_of_instances: 1 + max_number_of_instances: 4 + capabilities: + virtual_compute: + properties: + virtual_memory: + virtual_mem_size: 6144 + numa_enabled: false + virtual_cpu: + num_virtual_cpu: 2 + requirements: + virtual_storage: + - "vdu-b-2-vsd" \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml b/SOL003/VNFLifecycleManagement-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d902779a2d42d34a9f93513512d8a485dc1d838b --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml @@ -0,0 +1,137 @@ +nfv: + vnfd: + - id: VNF-B-2vdu + provider: ETSI TST WG + product-name: TST010 reference VNF-B with 2 VDUs + software-version: '2.2' + version: '2.2' + vnfm-info: ETSI VNFM + vdu: + - id: vdu-b-1 + name: VNF-B VDU 1 + int-cpd: + - id: left + layer-protocol: ethernet + - id: management + layer-protocol: ethernet + - id: internal + layer-protocol: ethernet + int-virtual-link-desc: internal-vl + virtual-compute-desc: vdu-b-1-vcd + virtual-storage-desc: vdu-b-1-vsd + sw-image-desc: vdu-b-1-image + - id: vdu-b-2 + name: VNF-B VDU 2 + int-cpd: + - id: right + layer-protocol: ethernet + - id: management + layer-protocol: ethernet + - id: internal + layer-protocol: ethernet + int-virtual-link-desc: internal-vl + virtual-compute-desc: vdu-b-2-vcd + virtual-storage-desc: vdu-b-2-vsd + sw-image-desc: vdu-b-2-image + virtual-compute-desc: + id: vdu-b-1-vcd + virtual-memory: + size: '4.0' + virtual-cpu: + num-virtual-cpu: '2' + virtual-storage-desc: + id: vdu-b-1-vsd + type-of-storage: root-storage + size-of-storage: '0' + sw-image-desc: + id: vdu-b-1-image + name: VNF-B image + version: '1.1' + checksum: + algorithm: sha-224 + hash: somehashfortst010 + container-format: bare + disk-format: qcow2 + min-disk: '1' + min-ram: '2.0' + size: '1' + image: 'http://someurl.com/VNF-B.qcow2' + virtual-compute-desc: + id: vdu-b-2-vcd + virtual-memory: + size: '6.0' + virtual-cpu: + num-virtual-cpu: '2' + virtual-storage-desc: + id: vdu-b-2-vsd + type-of-storage: root-storage + size-of-storage: '0' + sw-image-desc: + id: vdu-b-2-image + name: VNF-B-2 image + version: '1.1' + checksum: + algorithm: sha-224 + hash: somehashfortst010 + container-format: bare + disk-format: qcow2 + min-disk: '1' + min-ram: '2.0' + size: '1' + image: 'http://someurl.com/VNF-B-2.qcow2' + int-virtual-link-desc: + - id: internal-vl + flavour: + id: internal-vl-flavour + qos: + latency: '1' + packet-delay-variation: '1' + packet-loss-ratio: '0.05' + connectivity-type: + layer-protocol: ethernet + ext-cpd: + - id: ext-b-left + int-cpd: + vdu-id: vdu-b-1 + cpd: left + layer-protocol: ethernet + - id: management + int-cpd: + vdu-id: vdu-b-1 + cpd: management + layer-protocol: ethernet + - id: ext-b-right + int-cpd: + vdu-id: vdu-b-2 + cpd: right + layer-protocol: ethernet + df: + id: normal + vdu-profile: + - id: vdu-b-1 + min-number-of-instances: '1' + max-number-of-instances: '2' + - id: vdu-b-2 + min-number-of-instances: '1' + max-number-of-instances: '4' + instantiation-level: + - id: double + vdu-level: + - vdu-id: vdu-b-1 + number-of-instances: '2' + - vdu-id: vdu-b-2 + number-of-instances: '2' + - id: single + vdu-level: + - vdu-id: vdu-b-1 + number-of-instances: '1' + - vdu-id: vdu-b-2 + number-of-instances: '1' + default-instantiation-level: single + lcm-operations-configuration: + scale-vnf-to-level-op-config: + arbitrary-target-levels-supported: 'true' + terminate-vnf-op-config: + min-graceful-termination: '1' + operate-vnf-op-config: + min-graceful-stop-timeout: '1' \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index b08bdeff5a1ca5c2ba645ecebfd1348118370f90..9d110b13abe439add8fed75525b9f4fb8a2d6eda 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -97,4 +97,29 @@ ${element} ${aspectId} ${scaleOutResponse} -${callbackResp} localhost \ No newline at end of file +${callbackResp} localhost + +${descriptorType} SOL001 +${check_descriptors} 1 + +${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute +${tosca_type_VNF} tosca.nodes.nfv.VNF +${tosca_type_virtual_link} tosca.nodes.nfv.VnfVirtualLink +${tosca_type_VDU_cp} tosca.nodes.nfv.VduCp +${tosca_type_storage} tosca.nodes.nfv.Vdu.VirtualBlockStorage + +@{VDU_IDs} +@{VNF_IDs} +@{virtualLink_IDs} +@{CP_IDs} +@{Storage_IDs} +@{internalCP_IDs} +@{externalCP_IDs} +@{InstantiationLevel_IDs} + +${Descriptor_ID} +${Provider} +${Product_Name} +${Software_Version} +${Descriptor_Version} +${Flavour_ID} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/jsons/createVnfRequest.json b/SOL003/VNFLifecycleManagement-API/jsons/createVnfRequest.json index 64ab8e55c3213ff0553dd3325e07b7384eddb07e..15a5f7f7d55b743b4ec3d2284656960023d6b7f4 100644 --- a/SOL003/VNFLifecycleManagement-API/jsons/createVnfRequest.json +++ b/SOL003/VNFLifecycleManagement-API/jsons/createVnfRequest.json @@ -1,6 +1,9 @@ {{ - "vnfdId": "{vnfdId}", "vnfInstanceName": "string", "vnfInstanceDescription": "string", - "metadata":{{}} + "vnfdId": "{vnfdId}", + "vnfProvider":"{vnfProvider}", + "vnfProductName":"{vnfProductName}", + "vnfSoftwareVersion":"{vnfSoftwareVersion}", + "vnfdVersion":"{vnfdVersion}" }} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/jsons/patchBodyRequest.json b/SOL003/VNFLifecycleManagement-API/jsons/patchBodyRequest.json index 0c8845c218393245163304406c1ef2556b4472fd..679cc4c7f673d5b02f730c67dd9679735cbb41f2 100644 --- a/SOL003/VNFLifecycleManagement-API/jsons/patchBodyRequest.json +++ b/SOL003/VNFLifecycleManagement-API/jsons/patchBodyRequest.json @@ -1,4 +1,7 @@ -{ - "vnfInstanceName": "vnf new name", - "vnfInstanceDescription": "new description" -} \ No newline at end of file +{{ + "vnfInstanceName": "vnf string", + "vnfInstanceDescription": "string", + "vnfdId": "{vnfdId}", + "vnfdVersion":"{vnfdVersion}", + "metadata":{{}} +}} \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot index 4f9ce517202167069ec659036e97fa8ef9f30b8c..2221c855819fe614f2e61367dafc3770053d5319 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot @@ -5,6 +5,9 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fals Library OperatingSystem Library JSONLibrary Library JSONSchemaLibrary schemas/ +Library Collections +Variables descriptors/SOL001/VNFD/vnfd_SOL001.yaml +Variables descriptors/SOL006/VNFD/vnfd_SOL006.yaml Documentation This resource represents grants. The client can use this resource to obtain permission ... from the NFVO to perform a particular VNF lifecycle operation. @@ -114,8 +117,9 @@ Send Request Grant Request in Synchronous mode Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to Grant Request ${template}= Get File jsons/grantRequest.json - ${body}= Format String ${template} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} vnfdId=${vnfdId} flavourId=${flavourId} + ${body}= Format String ${template} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} vnfdId=${Descriptor_ID} flavourId=${Flavour_ID} Post ${apiRoot}/${apiName}/${apiMajorVersion}/grants ${body} ${body}= Output response Set Suite Variable ${response} ${body} @@ -126,8 +130,9 @@ Send Request Grant Request in Asynchronous mode Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to Grant Request ${template}= Get File jsons/grantRequest.json - ${body}= Format String ${template} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} vnfdId=${vnfdId} flavourId=${flavourId} + ${body}= Format String ${template} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} vnfdId=${Descriptor_ID} flavourId=${Flavour_ID} Post ${apiRoot}/${apiName}/${apiMajorVersion}/grants ${body} ${body}= Output response Set Suite Variable ${response} ${body} @@ -138,23 +143,12 @@ Send Request for a new Grant Forbiden Operation Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to Grant Request ${template}= Get File jsons/grantRejectedRequest.json - ${body}= Format String ${template} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} vnfdId=${vnfdId} flavourId=${flavourId} + ${body}= Format String ${template} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} vnfdId=${Descriptor_ID} flavourId=${Flavour_ID} Post ${apiRoot}/${apiName}/${apiMajorVersion}/grants ${body} ${body}= Output response Set Suite Variable ${response} ${body} - -Send Request Grant Request - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${template}= Get File jsons/grantRequest.json - ${body}= Format String ${template} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} vnfdId=${vnfdId} flavourId=${flavourId} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/grants ${body} allow_redirects=false - ${resp} Output response - ${result}= evaluate json.loads(json.dumps(${resp})) json - Log ${result} - Set Suite Variable ${response} ${result} Check HTTP Response Status Code Is [Arguments] ${expected_status} @@ -205,8 +199,7 @@ Patch Grants Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Patch ${apiRoot}/${apiName}/${apiMajorVersion}/grants ${body}= Output response - Set Suite Variable ${response} ${body} - + Set Suite Variable ${response} ${body} Delete Grants Log Trying to perform a DELETE. This method should not be implemented @@ -216,4 +209,36 @@ Delete Grants ${body}= Output response Set Suite Variable ${response} ${body} +Add VNF Descriptor Content to Grant Request + PARSE the Descriptor File + +PARSE the Descriptor File + Run Keyword If '${descriptorType}'=='SOL001' Fetch Information from SOL001 descriptor file ELSE Fetch Information from SOL006 descriptor file + +Fetch Information from SOL001 descriptor file + ${descriptor_id}= Get Variable Value ${topology_template.node_templates.properties.descriptor_id} + ${provider}= Get Variable Value ${topology_template.node_templates.properties.provider} + ${product_name}= Get Variable Value ${topology_template.node_templates.properties.product_name} + ${software_version}= Get Variable Value ${topology_template.node_templates.properties.software_version} + ${descriptor_version}= Get Variable Value ${topology_template.node_templates.properties.descriptor_version} + ${flavour_id}= Get Variable Value ${topology_template.node_templates.properties.flavour_id} + Set Global Variable ${Descriptor_ID} ${descriptor_id} + Set Global Variable ${Provider} ${provider} + Set Global Variable ${Product_Name} ${product_name} + Set Global Variable ${Software_Version} ${software_version} + Set Global Variable ${Descriptor_Version} ${descriptor_version} + Set Global Variable ${Flavour_ID} ${flavour_id} + +Fetch Information from SOL006 descriptor file + ${descriptor_id}= Get Variable Value ${nfv.vnfd[0].id} + ${provider}= Get Variable Value ${nfv.vnfd[0].provider} + ${product_name}= Get Variable Value ${nfv.vnfd[0]['product-name']} + ${software_version}= Get Variable Value ${nfv.vnfd[0]['software-version']} + ${descriptor_version}= Get Variable Value ${nfv.vnfd[0].version} + Set Global Variable ${Descriptor_ID} ${descriptor_id} + Set Global Variable ${Provider} ${provider} + Set Global Variable ${Product_Name} ${product_name} + Set Global Variable ${Software_Version} ${software_version} + Set Global Variable ${Descriptor_Version} ${descriptor_version} + diff --git a/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot b/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot index 52b961997c6191823bc436e66840bce98168e18f..751e9c695d6ceaf9b3d7d97c26387d6fa56f028c 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot @@ -3,7 +3,10 @@ Resource environment/variables.txt Library OperatingSystem Library JSONLibrary Library JSONSchemaLibrary schemas/ +Library Collections Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Variables descriptors/SOL001/VNFD/vnfd_SOL001.yaml +Variables descriptors/SOL006/VNFD/vnfd_SOL006.yaml Documentation This resource represents an individual grant. The client can use this resource to read the grant. ... It is determined by means outside the scope of the present document, such as configuration or policy, ... how long an individual grant is available. @@ -33,6 +36,7 @@ GET an individual grant - Successful Get individual grant Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is grant + Check HTTP Response Body grant content against VNF Descriptor GET an individual grant - Process ongoing [Tags] no-synchronous-mode @@ -160,3 +164,76 @@ Check HTTP Response Body Json Schema Is [Arguments] ${input} ${schema} = Catenate ${input} .schema.json Validate Json ${schema} ${response['body']} + +Check HTTP Response Body grant content against VNF Descriptor + Run Keyword If ${check_descriptors} == 1 Check Individual grant Content + +Check Individual grant Content + PARSE the Descriptor File + Match the grant Response Attributes with Descriptors + +PARSE the Descriptor File + Run Keyword If '${descriptorType}'=='SOL001' Fetch Information from SOL001 descriptor file ELSE Fetch Information from SOL006 descriptor file + +Fetch Information from SOL001 descriptor file + @{VDU_labels}= Create List + @{VirtualLink_labels}= Create List + @{CP_labels}= Create List + FOR ${key} IN @{topology_template.node_templates.keys()} + ${key_type}= Get Variable Value ${topology_template.node_templates.${key}.type} + ${VDU_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_VDU_compute} + ${Link_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_virtual_link} + ${VDUcp_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_VDU_cp} + Run Keyword If ${VDU_check} Append To List ${VDU_labels} ${key} + Run Keyword If ${Link_check} Append To List ${VirtualLink_labels} ${key} + Run Keyword If ${VDUcp_check} Append To List ${CP_labels} ${key} + END + Set Global Variable @{VDU_IDs} @{VDU_labels} + Set Global Variable @{VirtualLink_IDs} @{VirtualLink_labels} + Set Global Variable @{CP_IDs} @{CP_labels} + +Fetch Information from SOL006 descriptor file + ${VDUcount}= Get Length ${nfv.vnfd[0].vdu} + ${extCP_count}= Get Length ${nfv.vnfd[0]['ext-cpd']} + ${virtualLink_count}= Get length ${nfv.vnfd[0]['int-virtual-link-desc']} + FOR ${key} IN @{nfv.vnfd[0].keys()} + ${VDU_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} vdu + Run Keyword If ${VDU_check} Get VDU IDs ${VDUcount} + ${extCP_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} ext-cpd + Run Keyword If ${extCP_check} Get External CP IDs ${extCP_count} + ${virtualLink_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} int-virtual-link-desc + Run Keyword If ${virtualLink_check} Get Virtual Link IDs ${virtualLink_count} + END + +Get VDU IDs + [Arguments] ${count} + @{VDU_labels}= Create List + @{Compute_labels}= Create List + FOR ${i} IN RANGE ${count} + Append To List ${VDU_labels} ${nfv.vnfd[0].vdu[${i}]['id']} + Append To List ${Compute_labels} ${nfv.vnfd[0].vdu[${i}]['virtual-compute-desc']} + END + Set Global Variable ${VDU_IDs} ${VDU_labels} + Set Global Variable ${Compute_IDs} ${Compute_labels} + +Get External CP IDs + [Arguments] ${count} + @{external_CPs}= Create List + FOR ${i} IN RANGE ${count} + Append To List ${external_CPs} ${nfv.vnfd[0].ext_cpd[${i}].id} + END + Set Global Variable ${externalCP_IDs} ${external_CPs} + +Get Virtual Link IDs + [Arguments] ${count} + ${VirtualLink_labels}= Create List + FOR ${i} IN RANGE ${count} + Append To List ${VirtualLink_labels} ${nfv.vnfd[0]['int-virtual-link-desc'][${i}]['id']} + END + Set Global Variable ${VirtualLink_IDs} ${VirtualLink_labels} + +Match the grant Response Attributes with Descriptors + Run Keyword If '${descriptorType}'=='SOL006' List Should Contain Value ${externalCP_IDs} ${response['body']['extVirtualLinks'][0]['extCps'][0]['cpdId']} + Run Keyword If '${descriptorType}'=='SOL001' List Should Contain Value @{CP_IDs} ${response['body']['extVirtualLinks'][0]['extCps'][0]['cpdId']} + List Should Contain Value ${VirtualLink_IDs} ${response['body']['extManagedVirtualLinkData'][0]['vnfVirtualLinkDescId']} + List Should Contain value ${Compute_IDs} ${response['body']['vimAssets']['computeResourceFlavours'][0]['vnfdVirtualComputeDescId']} diff --git a/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml b/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e9159106a9469826fc1afbdc1bcba43ebc86f61a --- /dev/null +++ b/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -0,0 +1,168 @@ +tosca_definitions_version: tosca_simple_yaml_1_2 +description: "TST010 reference VNF-B" +metadata: + descriptor_id: "VNF-B" + vendor: "ETSI TST WG" + version: "2.0" +topology_template: + substitution_mappings: + node_type: "tosca.nodes.nfv.VNF" + requirements: + virtual_link_management: + [management, virtual_link_management] + virtual_link_left: + [left, virtual_link_left] + virtual_link_right: + [right, virtual_link_right] + node_templates: + right: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 1 + requirements: + virtual_link_right: + virtual_binding: VDU-B-2 + management: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 0 + requirements: + virtual_link_management: + virtual_binding: VDU-B-1 + left: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 2 + requirements: + virtual_link_left: + virtual_binding: VDU-B-1 + internal_vl: + type: "tosca.nodes.nfv.VnfVirtualLink" + properties: + connectivity_type: + layer_protocols: [ ipv4 ] + description: Internal Virtual link in the VNF + vl_profile: + max_bitrate_requirements: + root: 100000 + leaf: 20000 + min_bitrate_requirements: + root: 10000 + leaf: 10000 + internal_vdu_b_1_cp: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 2 + requirements: + - virtual_binding: VDU-B-1 + - virtual_link: internal_vl + internal_vdu_b_2_cp: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 0 + requirements: + - virtual_binding: VDU-B-2 + - virtual_link: internal_vl + vdu_b_1_vsd: + type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage" + properties: + virtual_block_storage_data: + size_of_storage: 20 + rdma_enabled: false + sw_image_data: + name: "vdu-b-1 image" + version: "1.1" + checksum: + algorithm: "sha-224" + hash: "somehashfortst010" + container_format: "bare" + disk-format: qcow2 + min-disk: '1' + min-ram: '2' + size: '1' + artifacts: + sw_image: + type: "tosca.artifacts.nfv.SwImage" + file: vdu-b-1.qcow2 + vdu_b_2_vsd: + type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage" + properties: + virtual_block_storage_data: + size_of_storage: 20 + rdma_enabled: false + sw_image_data: + name: "vdu-b-2 image" + version: "1.1" + checksum: + algorithm: "sha-224" + hash: "somehashfortst010" + container_format: "bare" + disk-format: qcow2 + min-disk: '1' + min-ram: '2' + size: '1' + artifacts: + sw_image: + type: tosca.artifacts.nfv.SwImage + file: vdu-b-2.qcow2 + vnf_b_1_VNF: + type: "tosca.nodes.nfv.VNF" + properties: + descriptor_id: "VNF-B-2VDUs" + descriptor_version: "2.0" + provider: "ETSI TST WG" + product_name: "VNF-B-2VDUs" + software_version: "2.0" + product_info_name: "VNF-B-2VDUs" + product_info_description: "TST010 reference VNF-B with 2 VDUs" + flavour_id: "VNF-B-2VDU_flavor" + flavour_description: "VNF-B with 2 VDUs flavor" + vnfm_info: + etsivnfm: + - v2.3.1 + interfaces: + Vnflcm: + scale: + implementation: scale-example.yaml + terminate: + implementation: terminate-example.yaml + operate: + implementation: operate-example.yaml + VDU_B_1: + type: "tosca.nodes.nfv.Vdu.Compute" + properties: + name: "vdu-b-1-vcd" + descriptor: "Description of VDU-B-1" + vdu_profile: + min_number_of_instances: 1 + max_number_of_instances: 2 + capabilities: + virtual_compute: + properties: + virtual_memory: + virtual_mem_size: 4096 + numa_enabled: false + virtual_cpu: + num_virtual_cpu: 2 + requirements: + virtual_storage: + - "vdu-b-1-vsd" + VDU_B_2: + type: "tosca.nodes.nfv.Vdu.Compute" + properties: + name: "vdu-b-2-vcd" + descriptor: "Description of VDU-B-2" + vdu_profile: + min_number_of_instances: 1 + max_number_of_instances: 4 + capabilities: + virtual_compute: + properties: + virtual_memory: + virtual_mem_size: 6144 + numa_enabled: false + virtual_cpu: + num_virtual_cpu: 2 + requirements: + virtual_storage: + - "vdu-b-2-vsd" \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml b/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d902779a2d42d34a9f93513512d8a485dc1d838b --- /dev/null +++ b/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml @@ -0,0 +1,137 @@ +nfv: + vnfd: + - id: VNF-B-2vdu + provider: ETSI TST WG + product-name: TST010 reference VNF-B with 2 VDUs + software-version: '2.2' + version: '2.2' + vnfm-info: ETSI VNFM + vdu: + - id: vdu-b-1 + name: VNF-B VDU 1 + int-cpd: + - id: left + layer-protocol: ethernet + - id: management + layer-protocol: ethernet + - id: internal + layer-protocol: ethernet + int-virtual-link-desc: internal-vl + virtual-compute-desc: vdu-b-1-vcd + virtual-storage-desc: vdu-b-1-vsd + sw-image-desc: vdu-b-1-image + - id: vdu-b-2 + name: VNF-B VDU 2 + int-cpd: + - id: right + layer-protocol: ethernet + - id: management + layer-protocol: ethernet + - id: internal + layer-protocol: ethernet + int-virtual-link-desc: internal-vl + virtual-compute-desc: vdu-b-2-vcd + virtual-storage-desc: vdu-b-2-vsd + sw-image-desc: vdu-b-2-image + virtual-compute-desc: + id: vdu-b-1-vcd + virtual-memory: + size: '4.0' + virtual-cpu: + num-virtual-cpu: '2' + virtual-storage-desc: + id: vdu-b-1-vsd + type-of-storage: root-storage + size-of-storage: '0' + sw-image-desc: + id: vdu-b-1-image + name: VNF-B image + version: '1.1' + checksum: + algorithm: sha-224 + hash: somehashfortst010 + container-format: bare + disk-format: qcow2 + min-disk: '1' + min-ram: '2.0' + size: '1' + image: 'http://someurl.com/VNF-B.qcow2' + virtual-compute-desc: + id: vdu-b-2-vcd + virtual-memory: + size: '6.0' + virtual-cpu: + num-virtual-cpu: '2' + virtual-storage-desc: + id: vdu-b-2-vsd + type-of-storage: root-storage + size-of-storage: '0' + sw-image-desc: + id: vdu-b-2-image + name: VNF-B-2 image + version: '1.1' + checksum: + algorithm: sha-224 + hash: somehashfortst010 + container-format: bare + disk-format: qcow2 + min-disk: '1' + min-ram: '2.0' + size: '1' + image: 'http://someurl.com/VNF-B-2.qcow2' + int-virtual-link-desc: + - id: internal-vl + flavour: + id: internal-vl-flavour + qos: + latency: '1' + packet-delay-variation: '1' + packet-loss-ratio: '0.05' + connectivity-type: + layer-protocol: ethernet + ext-cpd: + - id: ext-b-left + int-cpd: + vdu-id: vdu-b-1 + cpd: left + layer-protocol: ethernet + - id: management + int-cpd: + vdu-id: vdu-b-1 + cpd: management + layer-protocol: ethernet + - id: ext-b-right + int-cpd: + vdu-id: vdu-b-2 + cpd: right + layer-protocol: ethernet + df: + id: normal + vdu-profile: + - id: vdu-b-1 + min-number-of-instances: '1' + max-number-of-instances: '2' + - id: vdu-b-2 + min-number-of-instances: '1' + max-number-of-instances: '4' + instantiation-level: + - id: double + vdu-level: + - vdu-id: vdu-b-1 + number-of-instances: '2' + - vdu-id: vdu-b-2 + number-of-instances: '2' + - id: single + vdu-level: + - vdu-id: vdu-b-1 + number-of-instances: '1' + - vdu-id: vdu-b-2 + number-of-instances: '1' + default-instantiation-level: single + lcm-operations-configuration: + scale-vnf-to-level-op-config: + arbitrary-target-levels-supported: 'true' + terminate-vnf-op-config: + min-graceful-termination: '1' + operate-vnf-op-config: + min-graceful-stop-timeout: '1' \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt b/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt index 8ba38cb43672af1e60cdd055959be4a7a73864ab..c9405aec8f1a2f8763ea801bcb07bd8cdaae4385 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt +++ b/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt @@ -41,4 +41,24 @@ ${VrQuotaAvailNotification} {} ${vnfInstanceId} myVnfInstanceId ${vnfLcmOpOccId} myLcmOccId ${vnfdId} myVnF -${flavourId} string \ No newline at end of file +${flavourId} string + +${descriptorType} SOL001 +${check_descriptors} 1 + +${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute +${tosca_type_virtual_link} tosca.nodes.nfv.VnfVirtualLink +${tosca_type_VDU_cp} tosca.nodes.nfv.VduCp + +@{VDU_IDs} +@{virtualLink_IDs} +@{CP_IDs} +@{externalCP_IDs} +@{Compute_IDs} + +${Descriptor_ID} +${Provider} +${Product_Name} +${Software_Version} +${Descriptor_Version} +${Flavour_ID} \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/IndividualSubscription.robot b/SOL003/VNFPackageManagement-API/IndividualSubscription.robot index 2219974bcdcb9ccf78570f9ae2824a016345649a..41839a657f0a1b90af8892c2edf659db9d5a9283 100644 --- a/SOL003/VNFPackageManagement-API/IndividualSubscription.robot +++ b/SOL003/VNFPackageManagement-API/IndividualSubscription.robot @@ -20,6 +20,7 @@ GET Individual VNF Package Subscription Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is PkgmSubscription Check HTTP Response Body Subscription Identifier matches the requested Subscription + Check HTTP Response Body of Individual Subscription content against VNF Descriptor GET Individual VNF Package Subscription with invalid resource identifier [Documentation] Test ID: 7.3.3.7.2 diff --git a/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot b/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot index 6732e9cb8b2731099e014044789eb259c488c886..875b06bf86d03760f60f8f6252a5f306821e43c2 100644 --- a/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot +++ b/SOL003/VNFPackageManagement-API/IndividualVNFPackage.robot @@ -5,6 +5,7 @@ Resource VNFPackageManagementKeywords.robot Library JSONLibrary Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false + *** Test Cases *** GET Individual VNF Package [Documentation] Test ID: 7.3.3.2.1 @@ -19,6 +20,7 @@ GET Individual VNF Package Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is vnfPkgInfo Check HTTP Response Body vnfPkgInfo Identifier matches the requested VNF Package + Check HTTP Response Body of Individual VNF Package content against VNF Descriptor GET Individual VNF Package with invalid resource identifier [Documentation] Test ID: 7.3.3.2.2 diff --git a/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index 88032d9755bd37d55e4836ccb23642c05e09ad0e..e46f876f8033376cbc3ed5c3409f5536e65493e2 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -9,7 +9,8 @@ Library Collections Library JSONSchemaLibrary schemas/ Library Process Library String - +Variables descriptors/SOL001/VNFD/vnfd_SOL001.yaml +Variables descriptors/SOL006/VNFD/vnfd_SOL006.yaml *** Keywords *** Get all VNF Packages @@ -1524,4 +1525,63 @@ GET OnBoarded VNF Packages with fields and exclude_default attribute selector Check Postcondition VNF Package Subscription is Deleted Log Check Postcondition Subscription is deleted GET individual VNF Package Subscription - Check HTTP Response Status Code Is 404 \ No newline at end of file + Check HTTP Response Status Code Is 404 + +Check HTTP Response Body of Individual VNF Package content against VNF Descriptor + Run Keyword If ${check_descriptors} == 1 Check Individual VNF Package Content + +Check Individual VNF Package Content + PARSE the Descriptor File + Match the VNF Package Response Attributes with Descriptors + +PARSE the Descriptor File + Run Keyword If '${descriptorType}'=='SOL001' Fetch Information from SOL001 descriptor file ELSE Fetch Information from SOL006 descriptor file + +Fetch Information from SOL001 descriptor file + ${descriptor_id}= Get Variable Value ${topology_template.node_templates.properties.descriptor_id} + ${provider}= Get Variable Value ${topology_template.node_templates.properties.provider} + ${product_name}= Get Variable Value ${topology_template.node_templates.properties.product_name} + ${software_version}= Get Variable Value ${topology_template.node_templates.properties.software_version} + ${descriptor_version}= Get Variable Value ${topology_template.node_templates.properties.descriptor_version} + Set Global Variable ${Descriptor_ID} ${descriptor_id} + Set Global Variable ${Provider} ${provider} + Set Global Variable ${Product_Name} ${product_name} + Set Global Variable ${Software_Version} ${software_version} + Set Global Variable ${Descriptor_Version} ${descriptor_version} + +Fetch Information from SOL006 descriptor file + ${descriptor_id}= Get Variable Value ${nfv.vnfd[0].id} + ${provider}= Get Variable Value ${nfv.vnfd[0].provider} + ${product_name}= Get Variable Value ${nfv.vnfd[0]['product-name']} + ${software_version}= Get Variable Value ${nfv.vnfd[0]['software-version']} + ${descriptor_version}= Get Variable Value ${nfv.vnfd[0].version} + Set Global Variable ${Descriptor_ID} ${descriptor_id} + Set Global Variable ${Provider} ${provider} + Set Global Variable ${Product_Name} ${product_name} + Set Global Variable ${Software_Version} ${software_version} + Set Global Variable ${Descriptor_Version} ${descriptor_version} + +Match the VNF Package Response Attributes with Descriptors + #Checking Response attributes with VNF Descriptors + Should Be Equal As Strings ${response['body']['vnfdId']} ${Descriptor_ID} + Should Be Equal As Strings ${response['body']['vnfProvider']} ${Provider} + Should Be Equal As Strings ${response['body']['vnfProductName']} ${Product_Name} + Should Be Equal As Strings ${response['body']['vnfSoftwareVersion']} ${Software_Version} + Should Be Equal As Strings ${response['body']['vnfdVersion']} ${Descriptor_Version} + + +Check HTTP Response Body of Individual Subscription content against VNF Descriptor + Run Keyword If ${check_descriptors} == 1 Check Individual VNF Subscription Content + +Check Individual VNF Subscription Content + PARSE the Descriptor File + Match the VNF subscription Response Attributes with Descriptors + +Match the VNF subscription Response Attributes with Descriptors + #Checking Response attributes with VNF Descriptors + Should Be Equal As Strings ${response['body']['filter']['vnfdId']} ${Descriptor_ID} + Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders'][0]['vnfProvider']} ${Provider} + Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders'][0]['vnfProducts'][0]['vnfProductName']} ${Product_Name} + Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders'][0]['vnfProducts']['versions'][0]['vnfSoftwareVersion']} ${Software_Version} + Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders'][0]['vnfProducts']['versions'][0]['vnfdVersion']} ${Descriptor_Version} + \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml b/SOL003/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e9159106a9469826fc1afbdc1bcba43ebc86f61a --- /dev/null +++ b/SOL003/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -0,0 +1,168 @@ +tosca_definitions_version: tosca_simple_yaml_1_2 +description: "TST010 reference VNF-B" +metadata: + descriptor_id: "VNF-B" + vendor: "ETSI TST WG" + version: "2.0" +topology_template: + substitution_mappings: + node_type: "tosca.nodes.nfv.VNF" + requirements: + virtual_link_management: + [management, virtual_link_management] + virtual_link_left: + [left, virtual_link_left] + virtual_link_right: + [right, virtual_link_right] + node_templates: + right: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 1 + requirements: + virtual_link_right: + virtual_binding: VDU-B-2 + management: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 0 + requirements: + virtual_link_management: + virtual_binding: VDU-B-1 + left: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 2 + requirements: + virtual_link_left: + virtual_binding: VDU-B-1 + internal_vl: + type: "tosca.nodes.nfv.VnfVirtualLink" + properties: + connectivity_type: + layer_protocols: [ ipv4 ] + description: Internal Virtual link in the VNF + vl_profile: + max_bitrate_requirements: + root: 100000 + leaf: 20000 + min_bitrate_requirements: + root: 10000 + leaf: 10000 + internal_vdu_b_1_cp: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 2 + requirements: + - virtual_binding: VDU-B-1 + - virtual_link: internal_vl + internal_vdu_b_2_cp: + type: "tosca.nodes.nfv.VduCp" + properties: + order: 0 + requirements: + - virtual_binding: VDU-B-2 + - virtual_link: internal_vl + vdu_b_1_vsd: + type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage" + properties: + virtual_block_storage_data: + size_of_storage: 20 + rdma_enabled: false + sw_image_data: + name: "vdu-b-1 image" + version: "1.1" + checksum: + algorithm: "sha-224" + hash: "somehashfortst010" + container_format: "bare" + disk-format: qcow2 + min-disk: '1' + min-ram: '2' + size: '1' + artifacts: + sw_image: + type: "tosca.artifacts.nfv.SwImage" + file: vdu-b-1.qcow2 + vdu_b_2_vsd: + type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage" + properties: + virtual_block_storage_data: + size_of_storage: 20 + rdma_enabled: false + sw_image_data: + name: "vdu-b-2 image" + version: "1.1" + checksum: + algorithm: "sha-224" + hash: "somehashfortst010" + container_format: "bare" + disk-format: qcow2 + min-disk: '1' + min-ram: '2' + size: '1' + artifacts: + sw_image: + type: tosca.artifacts.nfv.SwImage + file: vdu-b-2.qcow2 + vnf_b_1_VNF: + type: "tosca.nodes.nfv.VNF" + properties: + descriptor_id: "VNF-B-2VDUs" + descriptor_version: "2.0" + provider: "ETSI TST WG" + product_name: "VNF-B-2VDUs" + software_version: "2.0" + product_info_name: "VNF-B-2VDUs" + product_info_description: "TST010 reference VNF-B with 2 VDUs" + flavour_id: "VNF-B-2VDU_flavor" + flavour_description: "VNF-B with 2 VDUs flavor" + vnfm_info: + etsivnfm: + - v2.3.1 + interfaces: + Vnflcm: + scale: + implementation: scale-example.yaml + terminate: + implementation: terminate-example.yaml + operate: + implementation: operate-example.yaml + VDU_B_1: + type: "tosca.nodes.nfv.Vdu.Compute" + properties: + name: "vdu-b-1-vcd" + descriptor: "Description of VDU-B-1" + vdu_profile: + min_number_of_instances: 1 + max_number_of_instances: 2 + capabilities: + virtual_compute: + properties: + virtual_memory: + virtual_mem_size: 4096 + numa_enabled: false + virtual_cpu: + num_virtual_cpu: 2 + requirements: + virtual_storage: + - "vdu-b-1-vsd" + VDU_B_2: + type: "tosca.nodes.nfv.Vdu.Compute" + properties: + name: "vdu-b-2-vcd" + descriptor: "Description of VDU-B-2" + vdu_profile: + min_number_of_instances: 1 + max_number_of_instances: 4 + capabilities: + virtual_compute: + properties: + virtual_memory: + virtual_mem_size: 6144 + numa_enabled: false + virtual_cpu: + num_virtual_cpu: 2 + requirements: + virtual_storage: + - "vdu-b-2-vsd" \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml b/SOL003/VNFPackageManagement-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d902779a2d42d34a9f93513512d8a485dc1d838b --- /dev/null +++ b/SOL003/VNFPackageManagement-API/descriptors/SOL006/VNFD/vnfd_SOL006.yaml @@ -0,0 +1,137 @@ +nfv: + vnfd: + - id: VNF-B-2vdu + provider: ETSI TST WG + product-name: TST010 reference VNF-B with 2 VDUs + software-version: '2.2' + version: '2.2' + vnfm-info: ETSI VNFM + vdu: + - id: vdu-b-1 + name: VNF-B VDU 1 + int-cpd: + - id: left + layer-protocol: ethernet + - id: management + layer-protocol: ethernet + - id: internal + layer-protocol: ethernet + int-virtual-link-desc: internal-vl + virtual-compute-desc: vdu-b-1-vcd + virtual-storage-desc: vdu-b-1-vsd + sw-image-desc: vdu-b-1-image + - id: vdu-b-2 + name: VNF-B VDU 2 + int-cpd: + - id: right + layer-protocol: ethernet + - id: management + layer-protocol: ethernet + - id: internal + layer-protocol: ethernet + int-virtual-link-desc: internal-vl + virtual-compute-desc: vdu-b-2-vcd + virtual-storage-desc: vdu-b-2-vsd + sw-image-desc: vdu-b-2-image + virtual-compute-desc: + id: vdu-b-1-vcd + virtual-memory: + size: '4.0' + virtual-cpu: + num-virtual-cpu: '2' + virtual-storage-desc: + id: vdu-b-1-vsd + type-of-storage: root-storage + size-of-storage: '0' + sw-image-desc: + id: vdu-b-1-image + name: VNF-B image + version: '1.1' + checksum: + algorithm: sha-224 + hash: somehashfortst010 + container-format: bare + disk-format: qcow2 + min-disk: '1' + min-ram: '2.0' + size: '1' + image: 'http://someurl.com/VNF-B.qcow2' + virtual-compute-desc: + id: vdu-b-2-vcd + virtual-memory: + size: '6.0' + virtual-cpu: + num-virtual-cpu: '2' + virtual-storage-desc: + id: vdu-b-2-vsd + type-of-storage: root-storage + size-of-storage: '0' + sw-image-desc: + id: vdu-b-2-image + name: VNF-B-2 image + version: '1.1' + checksum: + algorithm: sha-224 + hash: somehashfortst010 + container-format: bare + disk-format: qcow2 + min-disk: '1' + min-ram: '2.0' + size: '1' + image: 'http://someurl.com/VNF-B-2.qcow2' + int-virtual-link-desc: + - id: internal-vl + flavour: + id: internal-vl-flavour + qos: + latency: '1' + packet-delay-variation: '1' + packet-loss-ratio: '0.05' + connectivity-type: + layer-protocol: ethernet + ext-cpd: + - id: ext-b-left + int-cpd: + vdu-id: vdu-b-1 + cpd: left + layer-protocol: ethernet + - id: management + int-cpd: + vdu-id: vdu-b-1 + cpd: management + layer-protocol: ethernet + - id: ext-b-right + int-cpd: + vdu-id: vdu-b-2 + cpd: right + layer-protocol: ethernet + df: + id: normal + vdu-profile: + - id: vdu-b-1 + min-number-of-instances: '1' + max-number-of-instances: '2' + - id: vdu-b-2 + min-number-of-instances: '1' + max-number-of-instances: '4' + instantiation-level: + - id: double + vdu-level: + - vdu-id: vdu-b-1 + number-of-instances: '2' + - vdu-id: vdu-b-2 + number-of-instances: '2' + - id: single + vdu-level: + - vdu-id: vdu-b-1 + number-of-instances: '1' + - vdu-id: vdu-b-2 + number-of-instances: '1' + default-instantiation-level: single + lcm-operations-configuration: + scale-vnf-to-level-op-config: + arbitrary-target-levels-supported: 'true' + terminate-vnf-op-config: + min-graceful-termination: '1' + operate-vnf-op-config: + min-graceful-stop-timeout: '1' \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/environment/variables.txt b/SOL003/VNFPackageManagement-API/environment/variables.txt index 1bb5c34f55b8713c22e0238f5e2b11bb5a0a6f2b..b5779a0e8f6fa744b0578a97642243528f610032 100644 --- a/SOL003/VNFPackageManagement-API/environment/variables.txt +++ b/SOL003/VNFPackageManagement-API/environment/variables.txt @@ -86,4 +86,14 @@ ${NEG_FILTER} nfvId=41fdd38a-3d4c-465c-83e0-f80e014425f8 # Negative case, ${fields} softwareImages,additionalArtifacts ${VAR_SEPERATOR} & -${callbackResp} localhost \ No newline at end of file +${callbackResp} localhost + +${descriptorType} SOL001 +${check_descriptors} 1 + +${Descriptor_ID} +${Provider} +${Product_Name} +${Software_Version} +${Descriptor_Version} +${Flavour_ID}