diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index fa1bf6c29899ae437cc7b821857086b8cd04979b..0472e3a83a071caee34b0b7506c5a6991f3314cd 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -513,8 +513,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 ${template}= Get File jsons/ScaleNs.json - ${body}= Format String ${template} scaleType=${scaleType} scaleTimeout=${scaleTimeout} scaleVnfType=${scaleVnfType} scaleGroupDescriptor=${scaleGroupDescriptor} scaleMemberVnfIndex=${scaleMemberVnfIndex} + ${body}= Format String ${template} scaleType=${scaleType} scaleTimeout=${scaleTimeout} scaleVnfType=${scaleVnfType} scaleGroupDescriptor=${scaleGroupDescriptor} scaleMemberVnfIndex=${scaleMemberVnfIndex} vnfInstantiationLevelId=${instantiationLevel_id} Post ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId}/scale ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} diff --git a/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot b/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot index 6cc466661d3bc86498e51d944fa421876034689b..2ad41997f72844ddd7540844f0662d523330eefb 100644 --- a/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot +++ b/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot @@ -1,10 +1,11 @@ *** Settings *** Library String -Resource environment/variables.txt +Resource environment/variables.txt Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false Library OperatingSystem Library JSONLibrary Library JSONSchemaLibrary schemas/ +Resource NSLCMOperationKeywords.robot Suite Setup Check resource existence and get CallbackUri @@ -65,12 +66,16 @@ 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 ${template} = Get File jsons/NsLcmOperationOccurrenceNotification.json - ${body}= Format String ${template} nsInstanceId=${nsInstanceId} nsLcmOpOccId=${nsLcmOpOccId} subscriptionId=${subscriptionId} + ${body}= Format String ${template} nsInstanceId=${nsInstanceId} nsLcmOpOccId=${nsLcmOpOccId} subscriptionId=${subscriptionId} affectedVnf=${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/jsons/NsLcmOperationOccurrenceNotification.json b/SOL005/NSLifecycleManagement-API/jsons/NsLcmOperationOccurrenceNotification.json index d5ed27cbaa573fa64680295cbcadd0d95a5e1bb0..414dc2d13a9ed979860eeea71f490620cac5a00d 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/NsLcmOperationOccurrenceNotification.json +++ b/SOL005/NSLifecycleManagement-API/jsons/NsLcmOperationOccurrenceNotification.json @@ -9,5 +9,6 @@ "notificationStatus":"START", "operationState":"PROCESSING", "isAutomaticInvocation":"True", + "affectedVnf": "{affectedVnf}", "_links":"" }} diff --git a/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json b/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json index 39d410cfd850b83ca62502e92146a32242934c2b..2aa88d663bd3bbc2e817ad739b407bbc98a3ccbf 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json +++ b/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json @@ -2,7 +2,11 @@ "scaleType": "{scaleType}", "timeout_ns_scale": {scaleTimeout}, "scaleVnfData": {{ + "vnfInstanceid": {}, "scaleVnfType": "{scaleVnfType}", + "scaleToLevelData": {{ + "vnfInstantiationLevelId": "{vnfInstantiationLevelId}" + }}, "scaleByStepData": {{ "scaling-group-descriptor": "{scaleGroupDescriptor}", "member-vnf-index": "{scaleMemberVnfIndex}" diff --git a/SOL005/VNFPackageManagement-API/IndividualSubscription.robot b/SOL005/VNFPackageManagement-API/IndividualSubscription.robot index b2b0c155fb94f3686f464ca6d95fd287b162c174..7fc5498cfd7f01aed131f75eee456b33425e0562 100644 --- a/SOL005/VNFPackageManagement-API/IndividualSubscription.robot +++ b/SOL005/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 PkgmSubscription content against VNF Descriptor GET Individual VNF Package Subscription with invalid resource identifier [Documentation] Test ID: 5.3.5.8.2 diff --git a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index 6f374726abe8389ebf8f9fe30ae73ad6b5b1a646..c886c0442d3c8ceb5e72dcda0c105d7f60c79f7f 100644 --- a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -737,8 +737,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 ${template}= Get File jsons/subscriptions.json - ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} + ${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 @@ -926,6 +927,41 @@ Check HTTP Response Body Subscription Identifier matches the requested Subscript Should Be Equal ${response['body']['id']} ${subscriptionId} Log Subscription identifier as expected +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} + +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} + Check Notification Endpoint &{notification_request}= Create Mock Request Matcher GET ${callback_endpoint} &{headers} = Create Dictionary Content-Type=application/json diff --git a/SOL005/VNFPackageManagement-API/jsons/subscriptions.json b/SOL005/VNFPackageManagement-API/jsons/subscriptions.json index 124004374232fc30da00625bcc01555365e8ddc9..0edaec10618b18fb4a319487a52b4b59c7bcaca8 100644 --- a/SOL005/VNFPackageManagement-API/jsons/subscriptions.json +++ b/SOL005/VNFPackageManagement-API/jsons/subscriptions.json @@ -1,6 +1,16 @@ {{ "callbackUri": "{callback_uri}{callback_endpoint}", "filter": {{ - "vnfPkgId": ["{vnfPkgId}"] + "vnfdId": ["{vnfdId}"], + "vnfPkgId": ["{vnfPkgId}"], + "vnfProductsFromProviders": {{ + "vnfProvider": {"vnfProvider"}, + "vnfProducts": {{ + "vnfProductName": {"vnfProductName"}, + "versions": {{ + "vnfSoftwareVersion": {"vnfSoftwareVersion"}, + "vnfdVersions": [{"vnfdVersions"}] + }} + }} }} }} \ No newline at end of file