diff --git a/SOL005/NSLifecycleManagement-API/IndividualNSInstance.robot b/SOL005/NSLifecycleManagement-API/IndividualNSInstance.robot index 32285a8d4f371d772a1e1fd50739c13acf98fa84..7ac92c14910a24172c19763f786ebc7438dffd94 100644 --- a/SOL005/NSLifecycleManagement-API/IndividualNSInstance.robot +++ b/SOL005/NSLifecycleManagement-API/IndividualNSInstance.robot @@ -32,6 +32,7 @@ GET Information about an individual NS Instance GET IndividualNSInstance Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is NsInstance + Check HTTP Response Body NsInstance content against VNF Descriptor PUT Individual NSInstance - Method not implemented [Documentation] Test ID: 5.3.2.2.3 diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index b871442b7e05828af342b4934c640e9fd75731b1..10dffb4c9db02330727bd51eaae941ce7848717d 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -8,6 +8,8 @@ Library OperatingSystem Library MockServerLibrary Library Collections Library String +Variables descriptors/SOL001/vnf-b-1_VNF.yaml + *** Keywords *** Initialize System @@ -221,6 +223,56 @@ POST New nsInstance ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} +Check HTTP Response Body NsInstance content against VNF Descriptor + #${check_descriptors} flag, 1 to check descriptors + 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 + + ${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} + + 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} + +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} + ${virtual_storage}= Get Variable Value ${nfv.vnfd[0].vdu[0].virtual-storage-desc} + + 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']['virtualStorageResourceInfo']['virtualStorageDescId']} ${virtual_storage} + +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 + POST New nsInstance with DISABLED nsd Log Create NS instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances Set Headers {"Accept":"${ACCEPT}"} diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index 02b7d79a87c0f41bd7198f675d48dbbf36309065..01df2b696b314d7c557bc924d7639c1a66167eb3 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -76,4 +76,15 @@ ${NEG_FILTER} attribute_not_exist=some_value ${NEG_SELECTOR} fields=wrong_field ${json} {"notificationStatus": ""} -${callbackResp} 127.0.0.1 \ No newline at end of file +${callbackResp} 127.0.0.1 + +${descriptorType} SOL001 +${vnfKey} {} +${check_descriptors} 1 + +${descriptor_id} +${provider} +${product_name} +${software_version} +${descriptor_version} +${flavour_id} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index 78d63f8ace249998b9ae70bbbaa61798939327ee..6f374726abe8389ebf8f9fe30ae73ad6b5b1a646 100644 --- a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -8,7 +8,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_veri Library Process Library MockServerLibrary Library String -Variables descriptors/SOL001/vnf-b-1_VNF.yaml +Variables descriptors/SOL001/vnf-b-1_VNF.yaml *** Keywords ***