diff --git a/.jenkins.sh b/.jenkins.sh index 22ed7fcf2e3f7c2036855e04f827591d5ae7c5c0..3fb76157ca75149aba2441174b27309a80b8ec45 100644 --- a/.jenkins.sh +++ b/.jenkins.sh @@ -12,7 +12,18 @@ run_dir="$(pwd)" echo "Using git branch $GIT_BRANCH" bash ./scripts/build-container.sh +ret=$? +if [ "$ret" != "0" ]; then + echo "build-container.sh failed" + exit -1 +fi + bash ./scripts/run-container.sh "${run_dir}" "$GIT_BRANCH" +ret=$? +if [ "$ret" != "0" ]; then + echo "run-container.sh failed" + exit -1 +fi if [[ "$GIT_BRANCH" =~ .*fix-plu$ ]]; then @@ -30,3 +41,4 @@ fi ret=$? echo "Final validation result: $ret" exit $ret + diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index 1da0b75437ff1d6e3d43aad164758c0f694fac55..7deaed7bf032b6f23e3ae9924e7a116a93d6b8f2 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -136,7 +136,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/problem+json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema}= Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFConfiguration-API/environment/variables.txt b/SOL002/VNFConfiguration-API/environment/variables.txt index c07ffa6c0036c3ee42ede3c381512ef35f98c39c..f76515b1c27206f4ca76e2d12920665b21956031 100644 --- a/SOL002/VNFConfiguration-API/environment/variables.txt +++ b/SOL002/VNFConfiguration-API/environment/variables.txt @@ -19,8 +19,4 @@ ${apiRoot} / ${apiName} vnfconfig ${apiMajorVersion} v1 -${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX - - - - +${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX \ No newline at end of file diff --git a/SOL002/VNFFaultManagement-API/Alarms.robot b/SOL002/VNFFaultManagement-API/Alarms.robot index bb0b3f23266ab91179d11f726a66829a594fd246..8e42500c69040d420e51943d1f3ffed25d61c687 100644 --- a/SOL002/VNFFaultManagement-API/Alarms.robot +++ b/SOL002/VNFFaultManagement-API/Alarms.robot @@ -352,7 +352,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot b/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot index 361cd2374bfb4d620da324493356f639c8e99e02..5267feeab81d580d0a9120c0b087a63936137469 100644 --- a/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot +++ b/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot @@ -112,7 +112,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot index fa7bfe6c1f7f6ae9ea584dd4d250993cfb5cb43c..c9c479a4fea15a7088ac6cf8fa2a769936ec8b49 100644 --- a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot +++ b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot @@ -192,7 +192,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFFaultManagement-API/IndividualSubscription.robot b/SOL002/VNFFaultManagement-API/IndividualSubscription.robot index 69ea95cd96aa03146936352444899a44f107447e..aab3d6de2a0859ab057f11ac7f8e93fd9a28cedc 100644 --- a/SOL002/VNFFaultManagement-API/IndividualSubscription.robot +++ b/SOL002/VNFFaultManagement-API/IndividualSubscription.robot @@ -147,7 +147,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFFaultManagement-API/Subscriptions.robot b/SOL002/VNFFaultManagement-API/Subscriptions.robot index 8d4742c4376602eb2161b6758b0b142ef0558043..31d39d6d207e5b01354097b3a7b295866d8a134d 100644 --- a/SOL002/VNFFaultManagement-API/Subscriptions.robot +++ b/SOL002/VNFFaultManagement-API/Subscriptions.robot @@ -317,7 +317,7 @@ Post Create subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Clear Requests ${callback_endpoint} @@ -424,7 +424,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFIndicator-API/IndividualSubscription.robot b/SOL002/VNFIndicator-API/IndividualSubscription.robot index 9ea1314f9adc4d8bd4ed79877f55d57bffded60a..c4f45268bfc4c9e9a82d281154a28609aa68ed49 100644 --- a/SOL002/VNFIndicator-API/IndividualSubscription.robot +++ b/SOL002/VNFIndicator-API/IndividualSubscription.robot @@ -168,7 +168,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFIndicator-API/IndividualVNFindicator.robot b/SOL002/VNFIndicator-API/IndividualVNFindicator.robot index 32c7b0348ccc66629462f74de307656ac2e3ca6a..dc41e3b50765d03a266c3773b832b37a5eeddd93 100644 --- a/SOL002/VNFIndicator-API/IndividualVNFindicator.robot +++ b/SOL002/VNFIndicator-API/IndividualVNFindicator.robot @@ -218,7 +218,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFIndicator-API/Subscriptions.robot b/SOL002/VNFIndicator-API/Subscriptions.robot index 2fb925c5d93281862327b8c19cf3b05e0bb9060e..ae668a49eee6549d56d16b2f06454f3c335b2472 100644 --- a/SOL002/VNFIndicator-API/Subscriptions.robot +++ b/SOL002/VNFIndicator-API/Subscriptions.robot @@ -282,7 +282,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK @@ -337,7 +338,7 @@ Post Create subscription - DUPLICATION &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Clear Requests ${callback_endpoint} @@ -357,7 +358,7 @@ Post Create subscription - NO-DUPLICATION &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Clear Requests ${callback_endpoint} diff --git a/SOL002/VNFIndicator-API/VNFIndicators.robot b/SOL002/VNFIndicator-API/VNFIndicators.robot index 6643bb7981adebea6f48080fbb729756c6fdb922..261791e7b0660af1b72f58342bb6f619f46014c8 100644 --- a/SOL002/VNFIndicator-API/VNFIndicators.robot +++ b/SOL002/VNFIndicator-API/VNFIndicators.robot @@ -286,7 +286,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${schema} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${jsonSchema}= Catenate SEPARATOR= ${schema} .schema.json Validate Json ${jsonSchema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot b/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot index 765eafcf6539bf7176170ff2b09dcd12e5c79c09..0287b43b36761ce6fb9022828dfc4d1fe9744fc7 100644 --- a/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot +++ b/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot @@ -214,7 +214,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot b/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot index ffbf9fda6c4040a243ab26004f01e693a8471854..0b516cb3dfc7b2acf803a0b19a29966685ec03a9 100644 --- a/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot +++ b/SOL002/VNFLifecycleManagement-API/VnfLcmOperationKeywords.robot @@ -40,6 +40,8 @@ Check Operation Occurrence Id Check HTTP Response Body Json Schema Is [Arguments] ${input} + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK @@ -854,7 +856,7 @@ Post Create subscription - DUPLICATION &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Clear Requests ${callback_endpoint} @@ -872,7 +874,7 @@ Post Create subscription - NO-DUPLICATION &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Clear Requests ${callback_endpoint} @@ -1130,8 +1132,16 @@ Fetch Information from SOL001 descriptor file @{VirtualLink_labels}= Create List @{CP_labels}= Create List @{Storage_labels}= Create List + FOR ${key} IN @{node_types.keys()} + ${node_type}= Get Variable Value ${node_types['${key}']['derived_from']} + ${is_VNF}= Run Keyword And Return Status Should Be Equal As Strings ${node_type} ${tosca_type_VNF} + Run Keyword If ${is_VNF} Set Global Variable ${tosca_type_derived_from_VNF} ${key} + END + ${derived_type_is_used}= Run Keyword And Return Status Should not be empty ${tosca_type_derived_from_VNF} + Run Keyword If ${derived_type_is_used} Set Global Variable ${tosca_type_VNF} ${tosca_type_derived_from_VNF} + FOR ${key} IN @{topology_template.node_templates.keys()} - ${key_type}= Get Variable Value ${topology_template.node_templates.${key}.type} + ${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} @@ -1153,12 +1163,12 @@ Fetch Information from SOL001 descriptor file Get VNF Attributes from SOL001 Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml [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} + ${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} diff --git a/SOL002/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml b/SOL002/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml index 7f25ee9101439e128289be886c0674e5faae0fb8..a5b1cab4e46010d0dab38c663927b893917a00a5 100644 --- a/SOL002/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml +++ b/SOL002/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_2 description: "TST010 reference VNF-B" imports: - - https://forge.etsi.org/rep/nfv/SOL001/raw/v2.7.1/etsi_nfv_sol001_vnfd_types.yaml + - https://forge.etsi.org/rep/nfv/SOL001/raw/v2.8.1/etsi_nfv_sol001_vnfd_types.yaml metadata: descriptor_id: "VNF-B" @@ -90,7 +90,6 @@ topology_template: order: 1 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: management: type: "tosca.nodes.nfv.VduCp" properties: @@ -98,7 +97,6 @@ topology_template: order: 0 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: left: type: "tosca.nodes.nfv.VduCp" properties: diff --git a/SOL002/VNFLifecycleManagement-API/environment/variables.txt b/SOL002/VNFLifecycleManagement-API/environment/variables.txt index 56cdb9f9c9443569da694080860f182ecb8781aa..3190038870788225d9e8ad2e01e8a53c8d734af0 100644 --- a/SOL002/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL002/VNFLifecycleManagement-API/environment/variables.txt @@ -87,20 +87,22 @@ ${check_descriptors} 1 ${descriptorType} SOL006 ${check_multiple_instances} 0 +#############internal variables used for descriptor parsing################ ${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute -${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +${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 +${tosca_type_derived_from_VNF} -@{VDU_IDs} -@{VNF_IDs} -@{virtualLink_IDs} -@{CP_IDs} -@{Storage_IDs} -@{internalCP_IDs} -@{externalCP_IDs} -@{InstantiationLevel_IDs} +${VDU_IDs} +${VNF_IDs} +${virtualLink_IDs} +${CP_IDs} +${Storage_IDs} +${internalCP_IDs} +${externalCP_IDs} +${InstantiationLevel_IDs} ${Descriptor_ID} ${Provider} diff --git a/SOL002/VNFPerformanceManagement-API/IndividualPmJob.robot b/SOL002/VNFPerformanceManagement-API/IndividualPmJob.robot index ef1fdb1c23596cdbf09f5771c74d9c1b9902afa7..b5dad77efb2679a4a47b2c73a420ad1ce9037d41 100644 --- a/SOL002/VNFPerformanceManagement-API/IndividualPmJob.robot +++ b/SOL002/VNFPerformanceManagement-API/IndividualPmJob.robot @@ -241,7 +241,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFPerformanceManagement-API/IndividualReport.robot b/SOL002/VNFPerformanceManagement-API/IndividualReport.robot index b45328fd1e7f7192dfe45ee0fde4ca55b12d62cb..3855e66848576425fb704b359683e501cd3fb954 100644 --- a/SOL002/VNFPerformanceManagement-API/IndividualReport.robot +++ b/SOL002/VNFPerformanceManagement-API/IndividualReport.robot @@ -155,7 +155,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFPerformanceManagement-API/IndividualThreshold.robot b/SOL002/VNFPerformanceManagement-API/IndividualThreshold.robot index 646e853c2a6906ff7fc82ce2c20be897f8c439aa..8e56dd2e6141b1cedb9526e02dac6b37f44e4819 100644 --- a/SOL002/VNFPerformanceManagement-API/IndividualThreshold.robot +++ b/SOL002/VNFPerformanceManagement-API/IndividualThreshold.robot @@ -243,7 +243,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFPerformanceManagement-API/PMJobs.robot b/SOL002/VNFPerformanceManagement-API/PMJobs.robot index 0e1993f3d41bbfdebaf77598f96de39f207d49ef..34b416d7c0ce646c9e8606dfc3db833071fe8e64 100644 --- a/SOL002/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL002/VNFPerformanceManagement-API/PMJobs.robot @@ -409,7 +409,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFPerformanceManagement-API/Thresholds.robot b/SOL002/VNFPerformanceManagement-API/Thresholds.robot index 0360763014b871a8a539e6560344c57af81fcc21..a016b2424bd9af964fc7191b47467575b1d11cf6 100644 --- a/SOL002/VNFPerformanceManagement-API/Thresholds.robot +++ b/SOL002/VNFPerformanceManagement-API/Thresholds.robot @@ -257,7 +257,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot b/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot index a5e14818d05d7daa5e00898a6c7d2df4211ad173..8651f5c8edc68ec3fd674690e33e1601bf286f8d 100644 --- a/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot +++ b/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot @@ -106,7 +106,7 @@ Send Post Request for VNF Performance Subscription Set headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${body_request}= Get File jsons/subscriptions.json - POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body_request} + POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body_request} allow_redirects=false ${output}= Output response Set Suite Variable ${response} ${output} Run Keyword If ${VNFM_CHECKS_NOTIF_ENDPOINT} == 1 @@ -137,7 +137,7 @@ Send Post Request for Duplicated VNF Performance Subscription Set headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${body_request}= Get File jsons/subscriptions.json - POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body_request} + POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body_request} allow_redirects=false ${output}= Output response Set Suite Variable ${response} ${output} # Integer response status 303 @@ -271,7 +271,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot b/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot index 408350d106a7ca489f4d3f084b606135e2ccde1a..f0cef11fb7d08105d3705f4aad11570f8ca535ea 100644 --- a/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot +++ b/SOL003/VNFFaultManagement-API/FaultManagement-APIKeyword.robot @@ -63,6 +63,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK @@ -271,7 +273,7 @@ POST Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify the notification endpoint has been tested @@ -291,7 +293,7 @@ Send POST Request for duplicated subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify the notification endpoint has been tested @@ -311,7 +313,7 @@ Send POST Request for duplicated subscription not permitted &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify the notification endpoint has been tested diff --git a/SOL003/VNFIndicator-API/VNFIndicatorsKeywords.robot b/SOL003/VNFIndicator-API/VNFIndicatorsKeywords.robot index 23c3a6a774cf762128ba01d6ab0522510ce1f0d5..99b6b765b5560b8fcd999a4e77d022c536d87d04 100644 --- a/SOL003/VNFIndicator-API/VNFIndicatorsKeywords.robot +++ b/SOL003/VNFIndicator-API/VNFIndicatorsKeywords.robot @@ -106,7 +106,7 @@ Send Post Request for VNF Indicator Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Log Verify the notification endpoint has been tested @@ -129,7 +129,7 @@ Send Post Request for Duplicated VNF indicator Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Log Verify the notification endpoint has been tested @@ -172,7 +172,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot index b4cc16f0cd930572b1d860c3a5f18dba6ae2d451..5d936ae9161f31ba31043a4d474399803c7ab672 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot @@ -82,9 +82,9 @@ PATCH Individual VNFInstance Conflict ... Pre-conditions: another LCM operation is ongoing ... Reference: Clause 5.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v2.8.1 ... Config ID: Config_prod_VNFM - ... Applicability: none + ... Applicability: ... Post-Conditions: VNFInstance not modified - PATCH individual vnfInstance + PATCH individual vnfInstance with conflict Check HTTP Response Status Code Is 409 Check HTTP Response Body Json Schema Is ProblemDetails @@ -132,5 +132,5 @@ Check resource existence Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${vnfInstanceId} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${instantiatedVnfInstanceId} Integer response status 200 \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index 9b76a7912a0d9439e09c7a30fcede74ab2429500..0bbb405b1cfff8ec36b1fb918e61c87f9e1abd96 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -42,6 +42,8 @@ Check Operation Occurrence Id existence Check HTTP Response Body Json Schema Is [Arguments] ${input} + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK @@ -569,6 +571,29 @@ PATCH individual vnfInstance ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} +POST conflicting operation + Log Trying to create conflicting operation. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${template}= Get File jsons/terminateVnfRequest.json + ${body}= Format String ${template} terminationType=${terminationType} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${anotherInstantiatedVnfInstanceId}/terminate ${body} + +PATCH individual vnfInstance with conflict + POST conflicting operation + log Trying to modify an individual VNF instance with conflict + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + 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/${anotherInstantiatedVnfInstanceId} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + + PATCH individual vnfInstance - Etag mismatch log Trying to modify an individual VNF instance Set Headers {"Accept":"${ACCEPT}"} @@ -1287,7 +1312,7 @@ Post Create subscription - DUPLICATION &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify notification endpoint is tested @@ -1309,7 +1334,7 @@ Post Create subscription - NO-DUPLICATION &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify notification endpoint is tested @@ -1528,14 +1553,22 @@ 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 - Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml + Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @{VDU_labels}= Create List @{VNF_labels}= Create List @{VirtualLink_labels}= Create List @{CP_labels}= Create List @{Storage_labels}= Create List + FOR ${key} IN @{node_types.keys()} + ${node_type}= Get Variable Value ${node_types['${key}']['derived_from']} + ${is_VNF}= Run Keyword And Return Status Should Be Equal As Strings ${node_type} ${tosca_type_VNF} + Run Keyword If ${is_VNF} Set Global Variable ${tosca_type_derived_from_VNF} ${key} + END + ${derived_type_is_used}= Run Keyword And Return Status Should not be empty ${tosca_type_derived_from_VNF} + Run Keyword If ${derived_type_is_used} Set Global Variable ${tosca_type_VNF} ${tosca_type_derived_from_VNF} + FOR ${key} IN @{topology_template.node_templates.keys()} - ${key_type}= Get Variable Value ${topology_template.node_templates.${key}.type} + ${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} @@ -1556,13 +1589,13 @@ Fetch Information from SOL001 descriptor file Get VNF Attributes from SOL001 [Arguments] ${VNF_label} - Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml - ${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} + Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml + ${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} diff --git a/SOL003/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml b/SOL003/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml index 2694612e317d0d0b3c6098b48f91aae3d852f0fe..e770a8cd4c92f15b995f953c134a99ba9735efac 100644 --- a/SOL003/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml +++ b/SOL003/VNFLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -90,7 +90,6 @@ topology_template: order: 1 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: management: type: "tosca.nodes.nfv.VduCp" properties: @@ -98,7 +97,6 @@ topology_template: order: 0 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: left: type: "tosca.nodes.nfv.VduCp" properties: @@ -164,4 +162,4 @@ topology_template: terminate: implementation: terminate-example.yaml operate: - implementation: operate-example.yaml + implementation: operate-example.yaml \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index bf398e841add112e8a28d28606c1b3908714d3fe..6c64aa34b96d8b7031475699d1b43d73459e23a7 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -32,6 +32,7 @@ ${WRONG_ACCEPT} application/json ${SYNC_MODE} 0 ${instantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${anotherInstantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${notInstantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${notExistingVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f @@ -110,20 +111,22 @@ ${callbackResp} localhost ${descriptorType} SOL001 ${check_descriptors} 1 +#############internal variables used for descriptor parsing################ ${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute -${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +${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} +${tosca_type_derived_from_VNF} + +${VDU_IDs} +${VNF_IDs} +${virtualLink_IDs} +${CP_IDs} +${Storage_IDs} +${internalCP_IDs} +${externalCP_IDs} +${InstantiationLevel_IDs} ${Descriptor_ID} ${Provider} diff --git a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot index 24cd2bb5c5847758b1aaf41e265bddf6b216d4da..5859b67d2cfa30e3630c49d8f506f2fa120068ac 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot @@ -1,6 +1,7 @@ *** Settings *** Library String -Resource environment/variables.txt +Resource environment/variables.txt +Resource VNFLifecycleOperationGrantingKeywords.robot Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false Library OperatingSystem Library JSONLibrary @@ -12,7 +13,6 @@ Documentation This resource represents grants. The client can use this resour ... from the NFVO to perform a particular VNF lifecycle operation. *** Variables *** -${response} {} ${retry} 2 min ${polling} 10 sec @@ -110,137 +110,4 @@ DELETE Grants - Method not implemented *** Keywords *** Wait for individual grant successful notification - Wait Until Keyword Succeeds ${retry} ${polling} Get an individual grant - Successful -Send Request Grant Request in Synchronous mode - Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants - Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - 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=${Descriptor_ID} flavourId=${Flavour_ID} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/grants ${body} - ${body}= Output response - Set Suite Variable ${response} ${body} - -Send Request Grant Request in Asynchronous mode - Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants - Pass Execution If ${SYNC_MODE} == 1 The Granting process is synchronous mode. Skipping the test - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - 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=${Descriptor_ID} flavourId=${Flavour_ID} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/grants ${body} - ${body}= Output response - Set Suite Variable ${response} ${body} - -Send Request for a new Grant Forbiden Operation - Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants - Log The grant request should be rejected - Set Headers {"Accept": "${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - 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=${Descriptor_ID} flavourId=${Flavour_ID} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/grants ${body} - ${body}= Output response - Set Suite Variable ${response} ${body} - -Check HTTP Response Status Code Is - [Arguments] ${expected_status} - Should Be Equal As Strings ${response['status']} ${expected_status} - Log Status code validated - -Check Operation Occurrence Id existence - ${occId}= Get Value From Json ${response['headers']} $..Location - Should Not Be Empty ${occId} - -Check HTTP Response Header Contains - [Arguments] ${CONTENT_TYPE} - Should Contain ${response['headers']} ${CONTENT_TYPE} - Log Header is present - -Check HTTP Response Body Json Schema Is - [Arguments] ${input} - ${schema} = Catenate SEPARATOR= ${input} .schema.json - Validate Json ${schema} ${response['body']} - -Get an individual grant - Successful - log Trying to read an individual grant - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Get ${response['headers']['Location']} - Log Validate Status code - Integer response status 200 - -Get Grants - Log Trying to perform a GET. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion}/grants - ${body}= Output response - Set Suite Variable ${response} ${body} - -Put Grants - Log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Put ${apiRoot}/${apiName}/${apiMajorVersion}/grants - ${body}= Output response - Set Suite Variable ${response} ${body} - -Patch Grants - Log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Patch ${apiRoot}/${apiName}/${apiMajorVersion}/grants - ${body}= Output response - Set Suite Variable ${response} ${body} - -Delete Grants - Log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Delete ${apiRoot}/${apiName}/${apiMajorVersion}/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 - Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml - ${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 - Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml - ${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} - - + Wait Until Keyword Succeeds ${retry} ${polling} Get an individual grant - Successful \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot b/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot index 3fa55f01f8195e68733794d890c0946e7f42668d..c3dbba6ba5f2a263f5f052630317b246dec85fe1 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/IndividualGrant.robot @@ -1,5 +1,6 @@ *** Settings *** -Resource environment/variables.txt +Resource environment/variables.txt +Resource VNFLifecycleOperationGrantingKeywords.robot Library OperatingSystem Library JSONLibrary Library JSONSchemaLibrary schemas/ @@ -100,145 +101,4 @@ DELETE an individual grant - Method not implemented ... Applicability: none ... Post-Conditions: none Delete individual Grant - Check HTTP Response Status Code Is 405 - -*** Keywords *** -Get individual grant - log Trying to read an individual grant - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} - ${body}= Output response - Set Suite Variable ${response} ${body} - -Check resource existence - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} - Integer response status 200 - -Post individual Grant - log Trying to read an individual grant - Pass Execution If ${SYNC_MODE} == 1 Skipping. Synchronous mode is supported - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} - ${body}= Output response - Set Suite Variable ${response} ${body} - -Put individual Grant - Log Trying to perform a GET. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Put ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} - ${body}= Output response - Set Suite Variable ${response} ${body} - -Patch individual Grant - Log Trying to perform a GET. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Patch ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} - ${body}= Output response - Set Suite Variable ${response} ${body} - -Delete individual Grant - Log Trying to perform a GET. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} - Delete ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} - ${body}= Output response - Set Suite Variable ${response} ${body} - -Check HTTP Response Status Code Is - [Arguments] ${expected_status} - Should Be Equal As Strings ${response['status']} ${expected_status} - Log Status code validated - -Check HTTP Response Header Contains - [Arguments] ${CONTENT_TYPE} - Should Contain ${response['headers']} ${CONTENT_TYPE} - Log Header is present - -Check HTTP Response Body Json Schema Is - [Arguments] ${input} - ${schema} = Catenate SEPARATOR= ${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 - Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml - @{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 - Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml - ${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} - Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml - @{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} - Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml - @{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} - Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml - ${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']} + Check HTTP Response Status Code Is 405 \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/VNFLifecycleOperationGrantingKeywords.robot b/SOL003/VNFLifecycleOperationGranting-API/VNFLifecycleOperationGrantingKeywords.robot new file mode 100644 index 0000000000000000000000000000000000000000..fc02bff6a38c834a7f0d6e2780b515e92318bbba --- /dev/null +++ b/SOL003/VNFLifecycleOperationGranting-API/VNFLifecycleOperationGrantingKeywords.robot @@ -0,0 +1,311 @@ +*** Settings *** +Library String +Resource environment/variables.txt +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library Collections + +*** Variables *** +${retry} 2 min +${polling} 10 sec + +*** Keywords *** +Wait for individual grant successful notification + Wait Until Keyword Succeeds ${retry} ${polling} Get an individual grant - Successful +Send Request Grant Request in Synchronous mode + Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants + Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File + ${template}= Get File jsons/grantRequest.json + ${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 in Asynchronous mode + Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants + Pass Execution If ${SYNC_MODE} == 1 The Granting process is synchronous mode. Skipping the test + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File + ${template}= Get File jsons/grantRequest.json + ${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 for a new Grant Forbiden Operation + Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/grants + Log The grant request should be rejected + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File + ${template}= Get File jsons/grantRejectedRequest.json + ${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} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${expected_status} + Log Status code validated + +Check Operation Occurrence Id existence + ${occId}= Get Value From Json ${response['headers']} $..Location + Should Not Be Empty ${occId} + +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response['headers']} ${CONTENT_TYPE} + Log Header is present + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate SEPARATOR= ${input} .schema.json + Validate Json ${schema} ${response['body']} + +Get an individual grant - Successful + log Trying to read an individual grant + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${response['headers']['Location']} + Log Validate Status code + Integer response status 200 + +Get Grants + Log Trying to perform a GET. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/grants + ${body}= Output response + Set Suite Variable ${response} ${body} + +Put Grants + Log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiMajorVersion}/grants + ${body}= Output response + Set Suite Variable ${response} ${body} + +Patch Grants + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiMajorVersion}/grants + ${body}= Output response + Set Suite Variable ${response} ${body} + +Delete Grants + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiMajorVersion}/grants + ${body}= Output response + Set Suite Variable ${response} ${body} + + +Get individual grant + log Trying to read an individual grant + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Check resource existence + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + Integer response status 200 + +Post individual Grant + log Trying to read an individual grant + Pass Execution If ${SYNC_MODE} == 1 Skipping. Synchronous mode is supported + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Put individual Grant + Log Trying to perform a GET. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Patch individual Grant + Log Trying to perform a GET. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} + ${body}= Output response + Set Suite Variable ${response} ${body} + +Delete individual Grant + Log Trying to perform a GET. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiMajorVersion}/grants/${grantId} + ${body}= Output response + Set Suite Variable ${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 + Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml + @{VDU_labels}= Create List + @{VNF_labels}= Create List + @{VirtualLink_labels}= Create List + @{CP_labels}= Create List + @{Storage_labels}= Create List + FOR ${key} IN @{node_types.keys()} + ${node_type}= Get Variable Value ${node_types['${key}']['derived_from']} + ${is_VNF}= Run Keyword And Return Status Should Be Equal As Strings ${node_type} ${tosca_type_VNF} + Run Keyword If ${is_VNF} Set Global Variable ${tosca_type_derived_from_VNF} ${key} + END + ${derived_type_is_used}= Run Keyword And Return Status Should not be empty ${tosca_type_derived_from_VNF} + Run Keyword If ${derived_type_is_used} Set Global Variable ${tosca_type_VNF} ${tosca_type_derived_from_VNF} + 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} + Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml + ${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 + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + ${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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + @{VDU_labels}= Create List + ${Storage_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 ${Storage_labels} ${nfv.vnfd[0].vdu[${i}]['virtual-storage-desc']} + Append To List ${Compute_labels} ${nfv.vnfd[0].vdu[${i}]['virtual-compute-desc']} + Get Internal CPs for each VDU ${i} + END + Set Global Variable ${VDU_IDs} ${VDU_labels} + Set Global Variable ${Storage_IDs} ${Storage_labels} + Set Global Variable ${Compute_IDs} ${Compute_labels} + +Get Internal CPs for each VDU + [Arguments] ${vdu} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + ${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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + @{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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + ${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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + @{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 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']} \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml b/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml index 2694612e317d0d0b3c6098b48f91aae3d852f0fe..e770a8cd4c92f15b995f953c134a99ba9735efac 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml +++ b/SOL003/VNFLifecycleOperationGranting-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -90,7 +90,6 @@ topology_template: order: 1 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: management: type: "tosca.nodes.nfv.VduCp" properties: @@ -98,7 +97,6 @@ topology_template: order: 0 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: left: type: "tosca.nodes.nfv.VduCp" properties: @@ -164,4 +162,4 @@ topology_template: terminate: implementation: terminate-example.yaml operate: - implementation: operate-example.yaml + implementation: operate-example.yaml \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt b/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt index 1355aa15903c689bc10816a60754684e14160fdb..ee0d68edee1e3597f6726e3b34e2a5268cbcde45 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt +++ b/SOL003/VNFLifecycleOperationGranting-API/environment/variables.txt @@ -47,16 +47,24 @@ ${flavourId} string ${descriptorType} SOL001 ${check_descriptors} 1 -${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +#############internal variables used for descriptor parsing################ ${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 +${tosca_type_derived_from_VNF} -@{VDU_IDs} -@{virtualLink_IDs} -@{CP_IDs} -@{externalCP_IDs} -@{Compute_IDs} +${VDU_IDs} +${VNF_IDs} +${virtualLink_IDs} +${CP_IDs} +${externalCP_IDs} +${Storage_IDs} +${Compute_IDs} +${internalCP_IDs} +${externalCP_IDs} +${InstantiationLevel_IDs} ${Descriptor_ID} ${Provider} diff --git a/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index bad2ad8b028b13c863f5a6f2d861f0e3c0be6772..488768dd430efa3002cdd0c555deabbc849e6458 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -279,6 +279,7 @@ GET Individual VNF Package Content with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/package_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -288,6 +289,7 @@ GET Individual VNF Package Content with explicit Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/package_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -311,6 +313,7 @@ GET Individual VNF Package Content with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/package_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -415,7 +418,7 @@ Send Post Request for VNF Package Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Log Verify that the notification endpoint has been tested @@ -436,7 +439,7 @@ Send Post Request for Duplicated VNF Package Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Log Verify that the notification endpoint has been tested @@ -585,6 +588,7 @@ GET Individual VNF Package Artifact with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -595,6 +599,7 @@ GET Individual VNF Package Artifact with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -652,7 +657,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK @@ -1057,6 +1063,7 @@ GET Individual OnBoarded VNF Package Content with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/onboarded_vnf_packages/${vndId}/package_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1067,6 +1074,7 @@ GET Individual OnBoarded VNF Package Content with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/onboarded_vnf_packages/${vndId}/package_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1106,6 +1114,7 @@ GET Individual OnBoarded VNF Package Artifact with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/onboarded_vnf_packages/${vndId}/artifacts/${artifactPath} + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1116,6 +1125,7 @@ GET Individual OnBoarded VNF Package Artifact with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/onboarded_vnf_packages/${vndId}/artifacts/${artifactPath} + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1409,6 +1419,7 @@ Get Artifact in VNF Package with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/artifacts + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1442,6 +1453,7 @@ GET VNF Package Artifact with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/artifacts + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1524,6 +1536,7 @@ Get Artifact in OnBoarded VNF Package with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/onboarded_vnf_packages/${vnfPackageId}/artifacts + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1557,6 +1570,7 @@ GET OnBoarded VNF Package Artifact with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/onboarded_vnf_packages/${vnfPackageId}/artifacts + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1617,17 +1631,55 @@ 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 - Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml - ${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} + Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml + @{VDU_labels}= Create List + @{VNF_labels}= Create List + @{VirtualLink_labels}= Create List + @{CP_labels}= Create List + @{Storage_labels}= Create List + FOR ${key} IN @{node_types.keys()} + ${node_type}= Get Variable Value ${node_types['${key}']['derived_from']} + ${is_VNF}= Run Keyword And Return Status Should Be Equal As Strings ${node_type} ${tosca_type_VNF} + Run Keyword If ${is_VNF} Set Global Variable ${tosca_type_derived_from_VNF} ${key} + END + ${derived_type_is_used}= Run Keyword And Return Status Should not be empty ${tosca_type_derived_from_VNF} + Run Keyword If ${derived_type_is_used} Set Global Variable ${tosca_type_VNF} ${tosca_type_derived_from_VNF} + 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} + Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml + ${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 Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml @@ -1635,13 +1687,76 @@ Fetch Information from SOL006 descriptor file ${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} + ${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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + @{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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + ${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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + @{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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + ${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} + Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml + @{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 Package Response Attributes with Descriptors #Checking Response attributes with VNF Descriptors Should Be Equal As Strings ${response['body']['vnfdId']} ${Descriptor_ID} @@ -1665,4 +1780,4 @@ Match the VNF subscription Response Attributes with Descriptors 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 index 2694612e317d0d0b3c6098b48f91aae3d852f0fe..e770a8cd4c92f15b995f953c134a99ba9735efac 100644 --- a/SOL003/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml +++ b/SOL003/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -90,7 +90,6 @@ topology_template: order: 1 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: management: type: "tosca.nodes.nfv.VduCp" properties: @@ -98,7 +97,6 @@ topology_template: order: 0 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: left: type: "tosca.nodes.nfv.VduCp" properties: @@ -164,4 +162,4 @@ topology_template: terminate: implementation: terminate-example.yaml operate: - implementation: operate-example.yaml + implementation: operate-example.yaml \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/environment/variables.txt b/SOL003/VNFPackageManagement-API/environment/variables.txt index ad883bc3883b005429f9729be144d8a099e9bc96..2b806fa76ba042932a0c2a4b6c3c4ba7fe471a70 100644 --- a/SOL003/VNFPackageManagement-API/environment/variables.txt +++ b/SOL003/VNFPackageManagement-API/environment/variables.txt @@ -93,11 +93,26 @@ ${callbackResp} localhost ${descriptorType} SOL001 ${check_descriptors} 1 -${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +#############internal variables used for descriptor parsing################ +${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 +${tosca_type_derived_from_VNF} + +${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} +${Flavour_ID} \ No newline at end of file diff --git a/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot b/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot index 02b8a81c9fbbc10e73ef477151a7e2e6eeac2aaa..038559a01edcda205faa9e1ceb93931739b2bc9a 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualPmJob.robot @@ -265,7 +265,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL003/VNFPerformanceManagement-API/IndividualReport.robot b/SOL003/VNFPerformanceManagement-API/IndividualReport.robot index 12259bfe207df2f14b3ac5ffe1721a1348e0299f..9e7c5b73e89c14d490879a9a87e4d9c099f93e33 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualReport.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualReport.robot @@ -143,7 +143,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot b/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot index 878485dfe96b1d0cd7d34cf3bc08ce698f20a160..fd7ab02a5936eb5a10601f398e63bcfc3164219d 100644 --- a/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot +++ b/SOL003/VNFPerformanceManagement-API/IndividualThreshold.robot @@ -255,7 +255,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL003/VNFPerformanceManagement-API/PMJobs.robot b/SOL003/VNFPerformanceManagement-API/PMJobs.robot index d8bca91e540b877690da6f5108c78b82a82e1c3f..9c863b890541bdbbaa1baf9f22bbc91a3b0d7537 100644 --- a/SOL003/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL003/VNFPerformanceManagement-API/PMJobs.robot @@ -472,7 +472,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL003/VNFPerformanceManagement-API/Thresholds.robot b/SOL003/VNFPerformanceManagement-API/Thresholds.robot index e59f8a7971a93114d2febb3f61b892d9b3a1468e..a5a5c27922d76583d599f65fafcbd7d28124fe22 100644 --- a/SOL003/VNFPerformanceManagement-API/Thresholds.robot +++ b/SOL003/VNFPerformanceManagement-API/Thresholds.robot @@ -278,7 +278,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot index 4a9e77183be457f1bd2060d3c578cbfcaf9f4afd..bcfc85abbe4ab59dbc51e5933a06001213ee7b20 100644 --- a/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot +++ b/SOL003/VirtualisedResourcesQuotaAvailableNotification-API/VRQANOperationKeywords.robot @@ -34,6 +34,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK @@ -121,7 +123,7 @@ Send Post request for new Virtualised Resources Quota Available Notification sub &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify that the notification endpoint has been tested @@ -141,7 +143,7 @@ Send Post request for new Virtualised Resources Quota Available Notification sub &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify that the notification endpoint has been tested diff --git a/SOL005/NSDManagement-API/NSDManagementKeywords.robot b/SOL005/NSDManagement-API/NSDManagementKeywords.robot index 9eeb0abdf133493d30ca936305f2531cc75bf080..7bfbfb230ca691a9bbffca8f9876ece2da76266f 100644 --- a/SOL005/NSDManagement-API/NSDManagementKeywords.robot +++ b/SOL005/NSDManagement-API/NSDManagementKeywords.robot @@ -359,6 +359,7 @@ GET NSD Content with Range Request Set Headers {"Range": "${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -369,6 +370,7 @@ GET NSD Content with invalid Range Request Set Headers {"Range": "${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -671,6 +673,7 @@ Get PNFD Content with Range Request Set Headers {"Range": "${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -680,6 +683,7 @@ Get PNFD Content with invalid Range Request Set Headers {"Range": "${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -797,7 +801,7 @@ Send Post Request for NSD Management Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Clear Requests ${callback_endpoint} @@ -818,7 +822,7 @@ Send POST Request for Duplicated NSD Management Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Clear Requests ${callback_endpoint} @@ -866,7 +870,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Log ${response['body']} Validate Json ${schema} ${response['body']} diff --git a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot index 2c9daa406b99ae1aebbe3e9bf513c4463f9795ca..1d142a8251ab5764cea1d5a869cecd1614e3bf33 100644 --- a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot +++ b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot @@ -35,6 +35,8 @@ Check HTTP Response Header Contains Check HTTP Response Body Json Schema Is [Arguments] ${input} + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL005/NSFaultManagement-API/schemas/alarm.schema.json b/SOL005/NSFaultManagement-API/schemas/alarm.schema.json index 76fc395048b4f6a0b7d4a5ad2e7bfc127f7be059..5aadd14cd7b2e0f32beb78a7d6084972770added 100644 --- a/SOL005/NSFaultManagement-API/schemas/alarm.schema.json +++ b/SOL005/NSFaultManagement-API/schemas/alarm.schema.json @@ -157,7 +157,10 @@ }, "faultDetails": { "description": "Provides additional information about the fault..\n", - "type": "string" + "type": "array", + "items": { + "type": "string" + } }, "_links": { "description": "Links for this resource.\n", diff --git a/SOL005/NSFaultManagement-API/schemas/alarms.schema.json b/SOL005/NSFaultManagement-API/schemas/alarms.schema.json index 716025e5775725df1c3b92c4213841ac67ee3fdf..b43c87fb1721b96df740c6947c620eb715767bc7 100644 --- a/SOL005/NSFaultManagement-API/schemas/alarms.schema.json +++ b/SOL005/NSFaultManagement-API/schemas/alarms.schema.json @@ -159,7 +159,10 @@ }, "faultDetails": { "description": "Provides additional information about the fault..\n", - "type": "string" + "type": "array", + "items": { + "type": "string" + } }, "_links": { "description": "Links for this resource.\n", diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index de60b0830c29da5e799bf363e1a02fa059526d66..7b3dea2b3629382687466a7de15aa4c7d4d22ff1 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -219,6 +219,8 @@ Check Individual NS LCM operation occurrence operationState is Check HTTP Response Body Json Schema Is [Arguments] ${input} + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK @@ -267,14 +269,23 @@ 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 - Import Variables descriptors/SOL001/VNFD/vnfd_SOL001.yaml + Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @{VDU_labels}= Create List @{VNF_labels}= Create List @{VirtualLink_labels}= Create List @{CP_labels}= Create List @{Storage_labels}= Create List + + FOR ${key} IN @{node_types.keys()} + ${node_type}= Get Variable Value ${node_types['${key}']['derived_from']} + ${is_VNF}= Run Keyword And Return Status Should Be Equal As Strings ${node_type} ${tosca_type_VNF} + Run Keyword If ${is_VNF} Set Global Variable ${tosca_type_derived_from_VNF} ${key} + END + ${derived_type_is_used}= Run Keyword And Return Status Should not be empty ${tosca_type_derived_from_VNF} + Run Keyword If ${derived_type_is_used} Set Global Variable ${tosca_type_VNF} ${tosca_type_derived_from_VNF} + FOR ${key} IN @{topology_template.node_templates.keys()} - ${key_type}= Get Variable Value ${topology_template.node_templates.${key}.type} + ${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} @@ -295,13 +306,13 @@ Fetch Information from SOL001 descriptor file Get VNF Attributes from SOL001 [Arguments] ${VNF_label} - Import Variables descriptors/SOL001/VNFD/vnfd_SOL001.yaml - ${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} + Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml + ${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} @@ -1139,7 +1150,7 @@ POST subscriptions &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify that NFVO tested the notification endpoint @@ -1160,7 +1171,7 @@ POST subscriptions DUPLICATION &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify that NFVO tested the notification endpoint @@ -1181,7 +1192,7 @@ POST subscriptions NO DUPLICATION &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Log Verify that NFVO tested the notification endpoint diff --git a/SOL005/NSLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml b/SOL005/NSLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml index 2694612e317d0d0b3c6098b48f91aae3d852f0fe..e770a8cd4c92f15b995f953c134a99ba9735efac 100644 --- a/SOL005/NSLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml +++ b/SOL005/NSLifecycleManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -90,7 +90,6 @@ topology_template: order: 1 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: management: type: "tosca.nodes.nfv.VduCp" properties: @@ -98,7 +97,6 @@ topology_template: order: 0 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: left: type: "tosca.nodes.nfv.VduCp" properties: @@ -164,4 +162,4 @@ topology_template: terminate: implementation: terminate-example.yaml operate: - implementation: operate-example.yaml + implementation: operate-example.yaml \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index 6cb07cd188cb691189a83afd42cc22296cb0c19a..6200359751bb5995e6a78bce04f433584b0a1085 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -82,28 +82,30 @@ ${callbackResp} 127.0.0.1 ${check_descriptors} 1 ${descriptorType} SOL006 +#############internal variables used for descriptor parsing################ ${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute -${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +${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 +${tosca_type_derived_from_VNF} ${tosca_type_NS} tosca.nodes.nfv.NS ${tosca_type_NsVirtualLink} tosca.nodes.nfv.NsVirtualLink ${tosca_type_NsCP} tosca.nodes.nfv.Cp -@{VDU_IDs} -@{VNF_IDs} -@{virtualLink_IDs} -@{CP_IDs} -@{Storage_IDs} -@{internalCP_IDs} -@{externalCP_IDs} -@{InstantiationLevel_IDs} - -@{NS_VirtualLink_IDs} -@{NsCP_IDs} -@{SAP_IDs} +${VDU_IDs} +${VNF_IDs} +${virtualLink_IDs} +${CP_IDs} +${Storage_IDs} +${internalCP_IDs} +${externalCP_IDs} +${InstantiationLevel_IDs} + +${NS_VirtualLink_IDs} +${NsCP_IDs} +${SAP_IDs} ${NS_DescriptorID} ${Designer} @@ -111,7 +113,6 @@ ${NS_Name} ${NS_Version} ${NS_InvariantId} - ${Descriptor_ID} ${Provider} ${Product_Name} diff --git a/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot b/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot index 245f8488233b43b8d6edfa0aea3e4605a9a89958..ab2bbddea4d83ccf90db028710b0fa90f98b9f60 100644 --- a/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot +++ b/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot @@ -586,7 +586,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK diff --git a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index 6e0976a6c4004297b3c0d77d8eab3961bbb224a4..fb533648804906740c40c938c4033a1997bd8c0f 100644 --- a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -197,11 +197,45 @@ PARSE the Descriptor File Fetch Information from SOL001 descriptor file Import Variables ${CURDIR}/descriptors/SOL001/VNFD/vnfd_SOL001.yaml - ${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} + @{VDU_labels}= Create List + @{VNF_labels}= Create List + @{VirtualLink_labels}= Create List + @{CP_labels}= Create List + @{Storage_labels}= Create List + FOR ${key} IN @{node_types.keys()} + ${node_type}= Get Variable Value ${node_types['${key}']['derived_from']} + ${is_VNF}= Run Keyword And Return Status Should Be Equal As Strings ${node_type} ${tosca_type_VNF} + Run Keyword If ${is_VNF} Set Global Variable ${tosca_type_derived_from_VNF} ${key} + END + ${derived_type_is_used}= Run Keyword And Return Status Should not be empty ${tosca_type_derived_from_VNF} + Run Keyword If ${derived_type_is_used} Set Global Variable ${tosca_type_VNF} ${tosca_type_derived_from_VNF} + 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} Set Global Variable ${Descriptor_ID} ${descriptor_id} Set Global Variable ${Provider} ${provider} @@ -213,14 +247,73 @@ Fetch Information from SOL006 descriptor file Import Variables ${CURDIR}/descriptors/SOL006/VNFD/vnfd_SOL006.yaml ${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} + ${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 @@ -484,6 +577,7 @@ GET Individual VNF Package Content with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/package_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -493,6 +587,7 @@ GET Individual VNF Package Content with explicit Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/package_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -516,6 +611,7 @@ GET Individual VNF Package Content with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/package_content + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -649,6 +745,7 @@ GET Individual VNF Package Artifact with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -659,6 +756,7 @@ GET Individual VNF Package Artifact with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath} + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -805,7 +903,7 @@ Send Post Request for VNF Package Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Clear Requests ${callback_endpoint} @@ -824,7 +922,7 @@ Send Post Request for Duplicated VNF Package Subscription &{notification_response}= Create Mock Response status_code=204 Log Issue the subscription request Create Mock Expectation ${notification_request} ${notification_response} - Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false ${output}= Output response Set Global Variable ${response} ${output} Clear Requests ${callback_endpoint} @@ -984,7 +1082,8 @@ Check HTTP Response Status Code Is Check HTTP Response Body Json Schema Is [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} Log Json Schema Validation OK @@ -1195,6 +1294,7 @@ Get Artifact in VNF Package with Range Request Set Headers {"Range": "bytes=${range}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/artifacts + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} @@ -1228,6 +1328,7 @@ GET VNF Package Artifact with invalid Range Request Set Headers {"Range": "bytes=${erroneousRange}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} REST.GET ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_packages/${vnfPackageId}/artifacts + Unset Headers ["Range"] ${output}= Output response Set Suite Variable ${response} ${output} diff --git a/SOL005/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml b/SOL005/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml index 2694612e317d0d0b3c6098b48f91aae3d852f0fe..e770a8cd4c92f15b995f953c134a99ba9735efac 100644 --- a/SOL005/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml +++ b/SOL005/VNFPackageManagement-API/descriptors/SOL001/VNFD/vnfd_SOL001.yaml @@ -90,7 +90,6 @@ topology_template: order: 1 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: management: type: "tosca.nodes.nfv.VduCp" properties: @@ -98,7 +97,6 @@ topology_template: order: 0 requirements: - virtual_binding: VDU-B - vdu-b-1-vsd: left: type: "tosca.nodes.nfv.VduCp" properties: @@ -164,4 +162,4 @@ topology_template: terminate: implementation: terminate-example.yaml operate: - implementation: operate-example.yaml + implementation: operate-example.yaml \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/environment/variables.txt b/SOL005/VNFPackageManagement-API/environment/variables.txt index f6dd5c0e8ec828b2d89a4fb963960490e18984d6..c4655527234c1fcb831c752ce1c9e6e3cf68bf6a 100644 --- a/SOL005/VNFPackageManagement-API/environment/variables.txt +++ b/SOL005/VNFPackageManagement-API/environment/variables.txt @@ -93,20 +93,22 @@ ${callbackResp} 127.0.0.1 ${check_descriptors} 1 ${descriptorType} SOL006 +#############internal variables used for descriptor parsing################ ${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute -${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +${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} +${tosca_type_derived_from_VNF} + +${VDU_IDs} +${VNF_IDs} +${virtualLink_IDs} +${CP_IDs} +${Storage_IDs} +${internalCP_IDs} +${externalCP_IDs} +${InstantiationLevel_IDs} ${Descriptor_ID} ${Provider} diff --git a/internal_variables.txt b/internal_variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..85791f1cda5cc1894890111e2ab98108b3145dc2 --- /dev/null +++ b/internal_variables.txt @@ -0,0 +1,404 @@ +################################################################ +####################### v2.8.1-fix-plu ######################### +################################################################ + + +######################### SOL002 ############################### + + +### SOL002 VNFConfiguration-API ### + +${response}= httpresponse +${CONTENT_TYPE} application/json + +### SOL002 VNFFaultManagement-API ### + +${ACCEPT} application/json +${ACCEPT_JSON} application/json +${CONTENT_TYPE} application/json +${origResponse}= httpresponse +${CONTENT_TYPE_PATCH} application/merge-patch+json +${notification_request} [] +${notification_response} [] +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${response}= httpresponse +${AlarmNotification} {} +${AlarmClearedNotification} {} +${AlarmListRebuiltNotification} {} + +### SOL002 VNFIndicator-API ### + +${CONTENT_TYPE_JSON} application/json +#${ACCEPT_JSON} application/json +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${response} some_response_object +#${origResponse}= httpresponse +${vnfIndicators} + +### SOL002 VNFIndicatorNotification-API ### + +#${notification_request} [] +#${notification_response} [] +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + +### SOL002 VNFLifecycleManagement-API ### + +#${CONTENT_TYPE} application/json +#${CONTENT_TYPE_PATCH} application/merge-patch+json +#${ACCEPT} application/json +#${ACCEPT_JSON} application/json +${ACCEPT_PLAIN} text/plain +${ACCEPT_ZIP} application/zip +${ARTIFACT_TYPE} application/octet-stream +${WRONG_ACCEPT} application/json +${VnfLcmOperationOccurrenceNotification} {} +${VnfIdentifierCreationNotification} {} +${VnfIdentifierDeletionNotification} {} +#${notification_request} [] +#${notification_response} [] +#${response}= httpresponse +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + +${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute +${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +${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} + +${scaleVnfRequesttype} SCALE_OUT +${scaleVnfRequestAspect} Aspect + + +### SOL002 VNFPerformanceManagement-API ### + +#${CONTENT_TYPE_JSON} application/json +#${CONTENT_TYPE_PATCH} application/merge-patch+json +#${ACCEPT_JSON} application/json +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${response} http-response +${subscribe} /subscribe +${OrigResponse}= httpresponse + +### SOL002 VNFPerformanceManagementNotification-API ### + +#${notification_request} [] +#${notification_response} [] +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + + +######################### SOL003 ############################### + +### SOL003 VirtualizedQuotaAvailableNotification-API ### + +#${CONTENT_TYPE} application/json +#${ACCEPT} application/json +#${notification_request} [] +#${notification_response} [] +${VrQuotaAvailNotification} {} +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${response} {} + + +### SOL003 VNFFaultManagement-API ### + +#${CONTENT_TYPE} application/json +#${ACCEPT} application/json +#${ACCEPT_JSON} application/json +#${CONTENT_TYPE_PATCH} application/merge-patch+json +#${AlarmNotification} {} +#${AlarmClearedNotification} {} +#${AlarmListRebuiltNotification} {} +#${response} {} +${req_mock} {} +${resp_mock} {} +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + +### SOL003 VNFFaultManagementNotification-API ### + +#${notification_request} [] +#${notification_response} [] +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + + +### SOL003 VNFIndicator-API ### + +#${ACCEPT_JSON} application/json +#${CONTENT_TYPE_JSON} application/json +#${response} +#${notification_request} [] +#${notification_response} [] +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${origResponse} httpresponse + + +### SOL003 VNFLifecycleManagement-API ### + +#${ACCEPT} application/json +#${ACCEPT_JSON} application/json +#${CONTENT_TYPE} application/json +#${CONTENT_TYPE_PATCH} application/merge-patch+json +#${ACCEPT_PLAIN} text/plain +#${ACCEPT_ZIP} application/zip +#${ARTIFACT_TYPE} application/octet-stream +#${WRONG_ACCEPT} application/json +${VnfLcmOperationOccurrenceNotification} {} +${VnfIdentifierCreationNotification} {} +${VnfIdentifierDeletionNotification} {} +#${response} {} +${json} {} + +${changeVnfFlavourRequest} {} +${changeVnfOperateRequest} {} +${requestedState} test +${changeVnfExtConnectivityRequest} {} +${patchBodyRequest} {} + +#${notification_request} [] +#${notification_response} [] +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + +${LccnSubscriptions} +${scaleInfo} +${element} +${scaleOutResponse} + +#${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute +#${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +#${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} + + +### SOL003 VNFLifecycleOperationGranting-API ### + +#${CONTENT_TYPE} application/json +#${ACCEPT} application/json +#${response} {} +#${CONTENT_TYPE_PATCH} application/merge-patch+json +#${ACCEPT_PLAIN} text/plain +#${ACCEPT_ZIP} application/zip +#${ARTIFACT_TYPE} application/octet-stream +#${WRONG_ACCEPT} application/json +#${VrQuotaAvailNotification} {} + +#${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +#${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} + +#${Descriptor_ID} +#${Provider} +#${Product_Name} +#${Software_Version} +#${Descriptor_Version} + + +### SOL003 VNFPackageManagement-API ### + +#${ACCEPT_JSON} application/json +#${CONTENT_TYPE_JSON} application/json +#${response} httpresponse +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${notification_request} [] +#${notification_response} [] +#${origResponse} httpresponse +#${ACCEPT_PLAIN} text/plain +${CONTENT_TYPE_PLAIN} text/plain +#${ACCEPT_ZIP} application/zip +${CONTENT_TYPE_ZIP} application/zip + +${CONTENT_TYPE_OCTET} application/octet-stream + +#${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder + +#${Descriptor_ID} +#${Provider} +#${Product_Name} +#${Software_Version} +#${Descriptor_Version} + +### SOL003 VNFPerformanceManagement-API ### + + +#${CONTENT_TYPE_JSON} application/json +#${ACCEPT_JSON} application/json +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${response}= httpresponse +#${OrigResponse}= httpresponse +#${notification_request} [] +#${notification_response} [] + + +######################### SOL005 ############################### + +### SOL005 NSDManagement-API ### + +#${CONTENT_TYPE_JSON} application/json +#${ACCEPT_JSON} application/json +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${notification_request} [] +#${notification_response} [] +#${response} httpresponse +#${origResponse} httpresponse +#${ACCEPT_ZIP} application/zip +#${ACCEPT_PLAIN} text/plain +#${CONTENT_TYPE_ZIP} application/zip +#${CONTENT_TYPE_PLAIN} text/plain + +${NS_DescriptorID} +${Designer} +${NS_Name} +${NS_Version} +${NS_InvariantId} + +### SOL005 NSFaultManagement-API ### + +#${ACCEPT} application/json +#${ACCEPT_JSON} application/json +#${CONTENT_TYPE} application/json +#${CONTENT_TYPE_PATCH} application/merge-patch+json +#${AlarmNotification} {} +#${AlarmClearedNotification} {} +#${AlarmListRebuiltNotification} {} +#${response} {} +#${req_mock} {} +#${resp_mock} {} +#${notification_request} [] +#${notification_response} [] + +### SOL005 NSLifecycleManagement-API ### + +#${CONTENT_TYPE} application/json +#${CONTENT_TYPE_PATCH} application/merge-patch+json +#${ACCEPT_JSON} application/json +#${ACCEPT} application/json +#${ACCEPT_PLAIN} text/plain +#${ACCEPT_ZIP} application/zip +#${ARTIFACT_TYPE} application/octet-stream +#${WRONG_ACCEPT} application/json +#${VnfLcmOperationOccurrenceNotification} {} +#${VnfIdentifierCreationNotification} {} +#${VnfIdentifierDeletionNotification} {} +#${notification_request} {} +#${notification_response} {} +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${response} {} +#${json} {"notificationStatus": ""} + +#${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute +#${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +#${tosca_type_virtual_link} tosca.nodes.nfv.VnfVirtualLink +#${tosca_type_VDU_cp} tosca.nodes.nfv.VduCp +#${tosca_type_storage} tosca.nodes.nfv.Vdu.VirtualBlockStorage + +${tosca_type_NS} tosca.nodes.nfv.NS +${tosca_type_NsVirtualLink} tosca.nodes.nfv.NsVirtualLink +${tosca_type_NsCP} tosca.nodes.nfv.Cp + +${NS_VirtualLink_IDs} +${NsCP_IDs} +${SAP_IDs} + +#${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} + +#${NS_DescriptorID} +#${Designer} +#${NS_Name} +#${NS_Version} +#${NS_InvariantId} + +### SOL005 NSPerformanceManagement-API ### + +#${CONTENT_TYPE_JSON} application/json +#${ACCEPT_JSON} application/json +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${response} {} +#${CONTENT_TYPE_PATCH} application/merge-patch+json +#${origResponse}= httpresponse +#${notification_request} [] +#${notification_response} [] + + +### SOL005 VNFPackageManagement-API ### + +#${CONTENT_TYPE_JSON} application/json +#${ACCEPT_JSON} application/json +#${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +#${response} +#${notification_request} [] +#${notification_response} [] +#${origResponse} httpresponse +#${ACCEPT_PLAIN} text/plain +#${ACCEPT_ZIP} application/zip +#${CONTENT_TYPE_PLAIN} text/plain +#${CONTENT_TYPE_ZIP} application/zip +#${CONTENT_TYPE_OCTET} application/octet-stream + +#${tosca_type_VDU_compute} tosca.nodes.nfv.Vdu.Compute +#${tosca_type_VNF} tst010.vnf.simple # custom tosca type defined in the descriptor vnfd_SOL001.yaml in descriptors folder +#${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} diff --git a/requirements.txt b/requirements.txt index bafc102d3843316cb6cca0a589fffb5deb65e8f5..4f00299b7ec3c17280e3269345fe687d2d7815e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ ## To install the libraries, use: # pip -r requirements.txt - +git+https://github.com/etsi-cti-admin/RESTinstance robotframework==3.1 -RESTinstance==1.0.0rc4 +#RESTinstance==1.0.0rc4 robotframework-dependencylibrary==1.0.0.post1 robotframework-jsonlibrary==0.3 robotframework-jsonschemalibrary==1.0 diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile index bf5f18016e4e9c9175fbc6ee663c262a3e3009fd..9f082157bc7b1e5c57c486bc7d932e86f7177057 100644 --- a/scripts/docker/Dockerfile +++ b/scripts/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 MAINTAINER ETSI STF 583