diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index c7d01465b0e0445db242534bb8c6a7f47fcc8a22..c18055e3587d2bfb97a6202564a7ba4129dfe548 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -8,6 +8,7 @@ Library OperatingSystem Library MockServerLibrary Library Collections Library String +Variables descriptors/SOL006/reference_tst010_vnf_b_2vdu_SOL006.yaml Variables descriptors/SOL001/reference_tst010_vnf_b_2vdu_SOL001.yaml @@ -228,55 +229,139 @@ Check HTTP Response Body NsInstance content against VNF Descriptor Run Keyword If ${check_descriptors} == 1 Check Individual NsInstance Content Check Individual NsInstance Content - Run Keyword If '${descriptorType}'=='SOL001' Parse SOL001 ELSE Parse SOL006 - -Parse SOL001 - Get key for VNF Descriptor + PARSE the Descriptor File + Match the Response Attributes with Descriptors - ${descriptor_id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_id} - ${provider}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.provider} - ${product_name}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.product_name} - ${software_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.software_version} - ${descriptor_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_version} - ${flavour_id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.flavour_id} +PARSE the Descriptor File + Run Keyword If '${descriptorType}'=='SOL001' Fetch Information from SOL001 descriptor file ELSE Fetch Information from SOL006 descriptor file - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfdId']} ${descriptor_id} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfProvider']} ${provider} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfProductName']} ${product_name} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfSoftwareVesion']} ${software_version} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfdVersion']} ${descriptor_version} - Should Be Equal As Strings ${response['body']['vnfInstance']['instantiatedVnfInfo']['flavourId']} ${flavour_id} +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} -Parse SOL006 - ${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} - ${external_cp}= Get Variable Value ${nfv.vnfd[0].ext-cpd[0].id} - ${vdu_id}= Get Variable Value ${nfv.vnfd[0].vdu[0].id} - ${vdu_cpid}= Get Variable Value ${nfv.vnfd[0].vdu[0].int-cpd[2].id} - ${virtual_storage}= Get Variable Value ${nfv.vnfd[0].virtual-storage-desc.id} - ${virtual_link}= Get Variable Value ${nfv.vnfd[0].int-virtual-link-desc.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} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfdId']} ${descriptor_id} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfProvider']} ${provider} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfProductName']} ${product_name} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfSoftwareVesion']} ${software_version} - Should Be Equal As Strings ${response['body']['vnfInstance']['vnfdVersion']} ${descriptor_version} - Should Be Equal As Strings ${response['body']['vnfInstance']['instantiatedVnfInfo']['extCpInfo']['cpdId']} ${external_cp} - Should Be Equal As Strings ${response['body']['vnfInstance']['instantiatedVnfInfo']['vnfcResourceInfo']['vduId']} ${vdu_id} - Should Be Equal As Strings ${response['body']['vnfInstance']['instantiatedVnfInfo']['extCpInfo']['cpdId']} ${vdu_cpid} - Should Be Equal As Strings ${response['body']['vnfInstance']['instantiatedVnfInfo']['virtualStorageResourceInfo']['virtualStorageDescId']} ${virtual_storage} - Should Be Equal As Strings ${response['body']['vnfInstance']['instantiatedVnfInfo']['extManagedVirtualLinkInfo']['vnfVirtualLinkDescId']} ${virtual_link} +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 key for VNF Descriptor - FOR ${key} IN @{topology_template.node_templates.keys()} - Log ${key} - ${check1}= Run Keyword And Return Status Should End With ${key} VNF - Run Keyword If ${check1} Set Global Variable ${vnfKey} ${key} +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 Response Attributes with Descriptors + #Checking Response attributes with VNF Descriptors + Should Be Equal As Strings ${response['body']['vnfInstance']['vnfdId']} ${Descriptor_ID} + Should Be Equal As Strings ${response['body']['vnfInstance']['vnfProvider']} ${Provider} + Should Be Equal As Strings ${response['body']['vnfInstance']['vnfProductName']} ${Product_Name} + Should Be Equal As Strings ${response['body']['vnfInstance']['vnfSoftwareVesion']} ${Software_Version} + Should Be Equal As Strings ${response['body']['vnfInstance']['vnfdVersion']} ${Descriptor_Version} + Should Be Equal As Strings ${response['body']['vnfInstance']['instantiatedVnfInfo']['flavourId']} ${Flavour_ID} + List Should Contain Value ${VDU_IDs} ${response['body']['vnfInstance']['instantiatedVnfInfo']['vnfcResourceInfo']['vduId']} + Run Keyword If '${descriptorType}'=='SOL006' List Should Contain Value ${externalCP_IDs} ${response['body']['vnfInstance']['instantiatedVnfInfo']['extCpInfo']['cpdId']} + Run Keyword If '${descriptorType}'=='SOL006' List Should Contain Value ${internalCP_IDs} ${response['body']['vnfInstance']['instantiatedVnfInfo']['extCpInfo']['cpdId']} + Run Keyword If '${descriptorType}'=='SOL001' List Should Contain Value @{CP_IDs} ${response['body']['vnfInstance']['instantiatedVnfInfo']['extCpInfo']['cpdId']} + List Should Contain value ${Storage_IDs} ${response['body']['vnfInstance']['instantiatedVnfInfo']['virtualStorageResourceInfo']['virtualStorageDescId']} + List Should Contain Value ${VirtualLink_IDs} ${response['body']['vnfInstance']['instantiatedVnfInfo']['extManagedVirtualLinkInfo']['vnfVirtualLinkDescId']} POST New nsInstance with DISABLED nsd Log Create NS instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances @@ -518,9 +603,9 @@ POST scale nsInstance 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 NS Instance + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File ${template}= Get File jsons/ScaleNs.json - ${body}= Format String ${template} scaleType=${scaleType} scaleTimeout=${scaleTimeout} scaleVnfType=${scaleVnfType} scaleGroupDescriptor=${scaleGroupDescriptor} scaleMemberVnfIndex=${scaleMemberVnfIndex} vnfInstantiationLevelId=${instantiationLevel_id} + ${body}= Format String ${template} scaleType=${scaleType} scaleTimeout=${scaleTimeout} scaleVnfType=${scaleVnfType} scaleGroupDescriptor=${scaleGroupDescriptor} scaleMemberVnfIndex=${scaleMemberVnfIndex} vnfInstantiationLevelId=${InstantiationLevel_IDs[0]} Post ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}/scale ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} @@ -564,33 +649,12 @@ POST Update NSInstance 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 NS Instance + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File ${template} = Get File jsons/UpdateNsRequest.json - ${body}= Format String ${template} vnfdId=${descriptor_id} vnfFlavourId=${flavour_Id} newFlavourId=${flavour_Id} vnfVirtualLinkDescId=${virtualLink_id} instantiationLevelId=${instantiationLevel_id} vnfInstantiationLevelId=${instantiationLevel_id} + ${body}= Format String ${template} vnfdId=${descriptor_id} vnfFlavourId=${Flavour_ID} newFlavourId=${Flavour_ID} vnfVirtualLinkDescId=${VirtualLink_IDs[0]} instantiationLevelId=${InstantiationLevel_IDs[1]} vnfInstantiationLevelId=${InstantiationLevel_IDs[0]} Post ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}/update ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} - -Add VNF Descriptor Content to NS Instance - Run Keyword If '${descriptorType}'=='SOL001' Parse SOL001 NS Instance ELSE Parse SOL006 NS Instance - -Parse SOL001 NS Instance - Get key for VNF Descriptor - ${descriptor_id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_id} - ${provider}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.provider} - ${product_name}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.product_name} - ${software_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.software_version} - ${descriptor_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_version} - ${flavour_Id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.flavour_id} - -Parse SOL006 NS Instance - ${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} - ${virtualLink_id}= Get Variable Value ${nfv.vnfd[0].int-virtual-link-desc.id} - ${instantiationLevel_id}= Get Variable Value ${nfv.vnfd[0].df[0].instantiation-level[0].id} DELETE Heal NSInstance log Trying to Delete an Heal NS instance. This method should not be implemented diff --git a/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot b/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot index 546b1086054e9ce5495314d25f14c3360d067b30..a76b3a89959b1a13df8a40dfd76b3af18d1ebe04 100644 --- a/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot +++ b/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot @@ -66,16 +66,13 @@ Post Ns Lcm Operation Occurrence Notification 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 Notification + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File ${template} = Get File jsons/NsLcmOperationOccurrenceNotification.json - ${body}= Format String ${template} nsInstanceId=${nsInstanceId} nsLcmOpOccId=${nsLcmOpOccId} subscriptionId=${subscriptionId} vnfdId=${descriptor_id} + ${body}= Format String ${template} nsInstanceId=${nsInstanceId} nsLcmOpOccId=${nsLcmOpOccId} subscriptionId=${subscriptionId} vnfdId=${Descriptor_ID} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} - -Add VNF Descriptor Content to Notification - Run Keyword If '${descriptorType}'=='SOL001' Parse SOL001 NS Instance ELSE Parse SOL006 NS Instance - + Post Ns Identifier Creation Notification log Trying to perform a POST to get notification Set Headers {"Accept":"${ACCEPT}"} diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index f13e6903c4acdacda7b97b3a53a3d59a36f0e91f..f7346a6e5aa2ec9c3d8ef410ae6275205ecfcedd 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -78,16 +78,27 @@ ${json} {"notificationStatus": ""} ${callbackResp} 127.0.0.1 -${descriptorType} SOL001 -${vnfKey} {} -${check_descriptors} 1 +${check_descriptors} 1 +${descriptorType} SOL006 -${descriptor_id} -${provider} -${product_name} -${software_version} -${descriptor_version} -${flavour_id} +${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} -${virtualLink_id} -${instantiationLevel_id} \ No newline at end of file +${Descriptor_ID} +${Provider} +${Product_Name} +${Software_Version} +${Descriptor_Version} +${Flavour_ID} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/NotificationConsumer.robot b/SOL005/VNFPackageManagement-API/NotificationConsumer.robot index d8a5f00879f838d48b0405abe8a3855355d4e874..62fd52bc1d631c191b6899d2a4a3709b9dfc7e77 100644 --- a/SOL005/VNFPackageManagement-API/NotificationConsumer.robot +++ b/SOL005/VNFPackageManagement-API/NotificationConsumer.robot @@ -53,9 +53,9 @@ Post VNF Package Onboarding Notification Set Headers {"Accept":"${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to VNF Package + Run Keyword If ${check_descriptors} == 1 Parse the Descriptor File ${template} = Get File jsons/VnfPackageOnboardingNotification.json - ${body}= Format String ${template} subscriptionId=${subscriptionId} vnfPkgId=${vnfPkgId} vnfdId=${descriptor_id} + ${body}= Format String ${template} subscriptionId=${subscriptionId} vnfPkgId=${vnfPkgId} vnfdId=${Descriptor_ID} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} @@ -65,9 +65,9 @@ Post VNF Package Change Notification Set Headers {"Accept":"${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to VNF Package + Run Keyword If ${check_descriptors} == 1 Parse the Descriptor File ${template} = Get File jsons/VnfPackageChangeNotification.json - ${body}= Format String ${template} subscriptionId=${subscriptionId} vnfPkgId=${vnfPkgId} vnfdId=${descriptor_id} + ${body}= Format String ${template} subscriptionId=${subscriptionId} vnfPkgId=${vnfPkgId} vnfdId=${Descriptor_ID} Post ${callbackResp} ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index b1c600a40d1509a012112986c66da16af6d550ad..6842187b10c42760e8eb0457b30b0931a392d4d7 100644 --- a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -8,8 +8,10 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_veri Library Process Library MockServerLibrary Library String +Library Collections +Library String Variables descriptors/SOL001/reference_tst010_vnf_b_2vdu_SOL001.yaml - +Variables descriptors/SOL006/reference_tst010_vnf_b_2vdu_SOL006.yaml *** Keywords *** Get all VNF Packages @@ -175,73 +177,143 @@ Send Post Request to create new VNF Package Resource Log Creating a new VNF Package Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to VNF Package ${body} = Get File jsons/CreateVnfPkgInfoRequest.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages ${body} ${output}= Output response Set Suite Variable ${response} ${output} - -Get key for VNF Descriptor - FOR ${key} IN @{topology_template.node_templates.keys()} - Log ${key} - ${check1}= Run Keyword And Return Status Should End With ${key} VNF - Run Keyword If ${check1} Set Global Variable ${vnfKey} ${key} - END -Add VNF Descriptor Content to VNF Package - Run Keyword If '${descriptorType}'=='SOL001' Parse SOL001 VNF Package ELSE Parse SOL006 VNF Package - -Parse SOL001 VNF Package - Get key for VNF Descriptor - ${descriptor_id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_id} - ${provider}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.provider} - ${product_name}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.product_name} - ${software_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.software_version} - ${descriptor_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_version} -Parse SOL006 VNF Package - ${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} - Check HTTP Response Body vnfPkginfo content against VNF Descriptor #${check_descriptors} flag, 1 to check descriptors Run Keyword If ${check_descriptors} == 1 Check Individual VNFPkgInfo Content - + Check Individual VNFPkgInfo Content - Run Keyword If '${descriptorType}'=='SOL001' Parse SOL001 ELSE Parse SOL006 - -Parse SOL001 - Get key for VNF Descriptor + PARSE the Descriptor File + Match the Response Attributes of vnfPkgInfo with Descriptors - ${descriptor_id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_id} - ${provider}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.provider} - ${product_name}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.product_name} - ${software_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.software_version} - ${descriptor_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_version} +PARSE the Descriptor File + Run Keyword If '${descriptorType}'=='SOL001' Fetch Information from SOL001 descriptor file ELSE Fetch Information from SOL006 descriptor file - 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']['vnfSoftwareVesion']} ${software_version} - Should Be Equal As Strings ${response['body']['vnfdVersion']} ${descriptor_version} +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} -Parse SOL006 - ${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} - - 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']['vnfSoftwareVesion']} ${software_version} - Should Be Equal As Strings ${response['body']['vnfdVersion']} ${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} + ${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 Response Attributes of vnfPkgInfo 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']['vnfSoftwareVesion']} ${Software_Version} + Should Be Equal As Strings ${response['body']['vnfdVersion']} ${Descriptor_Version} + Check Postcondition VNF Package Resource Exists Log Checking that nsd info exists Set Headers {"Accept": "${ACCEPT_JSON}"} @@ -735,9 +807,9 @@ Send Post Request for VNF Package Subscription Log Trying to create a new subscription Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to VNF Package + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File ${template}= Get File jsons/subscriptions.json - ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} vnfdId=${descriptor_id} vnfProvider=${provider} vnfProductName=${product_name} vnfSoftwareVersion=${software_version} vnfdVersions=${descriptor_version} + ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} vnfdId=${Descriptor_ID} vnfProvider=${Provider} vnfProductName=${Product_Name} vnfSoftwareVersion=${Software_Version} vnfdVersions=${Descriptor_Version} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} ${output}= Output response @@ -929,36 +1001,16 @@ Check HTTP Response Body PkgmSubscription content against VNF Descriptor #${check_descriptors} flag, 1 to check descriptors Run Keyword If ${check_descriptors} == 1 Check Individual PkgmSubscription Content -Check Individual PkgmSubscription Content - Run Keyword If '${descriptorType}'=='SOL001' Parse SOL001 for Subscription ELSE Parse SOL006 for Subscription - -Parse SOL001 for Subscription - Get key for VNF Descriptor - - ${descriptor_id}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_id} - ${provider}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.provider} - ${product_name}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.product_name} - ${software_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.software_version} - ${descriptor_version}= Get Variable Value ${topology_template.node_templates.${vnfKey}.properties.descriptor_version} - - Should Be Equal As Strings ${response['body']['filter']['vnfdId']} ${descriptor_id} - Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProvider']} ${provider} - Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']} ${product_name} - Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']['versions']['vnfSoftwareVersion']} ${software_version} - Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']['versions']['vnfdVersion']} ${descriptor_version} +Check Individual PkgmSubscription Content + PARSE the Descriptor File + Match the Response Attributes of PkgmSubscription with Descriptors -Parse SOL006 for Subscription - ${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} - - Should Be Equal As Strings ${response['body']['filter']['vnfdId']} ${descriptor_id} - Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProvider']} ${provider} - Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']} ${product_name} - Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']['versions']['vnfSoftwareVersion']} ${software_version} - Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']['versions']['vnfdVersion']} ${descriptor_version} +Match the Response Attributes of PkgmSubscription with Descriptors + Should Be Equal As Strings ${response['body']['filter']['vnfdId']} ${Descriptor_ID} + Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProvider']} ${Provider} + Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']} ${Product_Name} + Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']['versions']['vnfSoftwareVersion']} ${Software_Version} + Should Be Equal As Strings ${response['body']['filter']['vnfProductsFromProviders']['vnfProducts']['vnfProductName']['versions']['vnfdVersion']} ${Descriptor_Version} Check Notification Endpoint &{notification_request}= Create Mock Request Matcher GET ${callback_endpoint} diff --git a/SOL005/VNFPackageManagement-API/environment/variables.txt b/SOL005/VNFPackageManagement-API/environment/variables.txt index 22b71fb754c4c1bf17fcc4269f599e4d8e915199..926a45ae2192547114932d3b358403e1fc9c44f3 100644 --- a/SOL005/VNFPackageManagement-API/environment/variables.txt +++ b/SOL005/VNFPackageManagement-API/environment/variables.txt @@ -86,12 +86,26 @@ ${NFVO_non-MANO_OK} 1 # If 1 means that non-MANO artifacts are supported b ${non_mano_artifact_sets} ${callbackResp} 127.0.0.1 -${descriptorType} SOL001 -${vnfKey} {} -${check_descriptors} 1 # If True test suite will validate VNF/NS descriptors - -${descriptor_id} -${provider} -${product_name} -${software_version} -${descriptor_version} \ No newline at end of file +${check_descriptors} 1 +${descriptorType} SOL006 + +${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}