Commit cf2703af authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Merge branch '2.7.1-dev' into '2.7.1-dev-SOL005-reference-descriptors'

# Conflicts:
#   SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot
parents c92a3ef7 47589eb5
......@@ -206,6 +206,6 @@ Check HTTP Response Status Code Is
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
${schema} = Catenate ${input} .schema.json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
\ No newline at end of file
......@@ -208,6 +208,6 @@ Check HTTP Response Status Code Is
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
${schema} = Catenate ${input} .schema.json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
\ No newline at end of file
......@@ -22,33 +22,46 @@ Create a new subscription
Check HTTP Response Header Contain Link
Check Postcondition resource exists
Create a new Subscription - DUPLICATION
[Documentation] Test ID: 6.3.4.4.2
... Test title: Create a new Subscription - DUPLICATION
... Test objective: The objective is to create a duplicate subscription.
... Pre-conditions: subscription with the same filter and callbackUri exists
... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v2.7.1
... Config ID: Config_prod_VNFM
... Applicability: the VNFM does not allow creation of a subscription resource if another subscription resource with the same filter and callbackUri already exists
... Post-Conditions: duplicated subscription is created
Post Create subscription - DUPLICATION
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is FmSubscription
Check HTTP Response Header Contain Link
Check Postcondition Duplicate Subscription exsist
# Create a new Subscription - DUPLICATION
# [Documentation] Test ID: 6.3.4.4.2
# ... Test title: Create a new Subscription - DUPLICATION
# ... Test objective: The objective is to create a duplicate subscription.
# ... Pre-conditions: subscription with the same filter and callbackUri exists
# ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v2.7.1
# ... Config ID: Config_prod_VNFM
# ... Applicability: the VNFM does not allow creation of a subscription resource if another subscription resource with the same filter and callbackUri already exists
# ... Post-Conditions: duplicated subscription is created
# Post Create subscription - DUPLICATION
# Check HTTP Response Status Code Is 201
# Check HTTP Response Body Json Schema Is FmSubscription
# Check HTTP Response Header Contain Link
# Check Postcondition Duplicate Subscription exsist
Create a new Subscription - NO-DUPLICATION
[Documentation] Test ID: 6.3.4.4.3
... Test title: Create a new Subscription - NO-DUPLICATION
... Test objective: The objective is to create a subscription in case of not allowed DUPLICATION.
# Create a new Subscription - NO-DUPLICATION
# [Documentation] Test ID: 6.3.4.4.3
# ... Test title: Create a new Subscription - NO-DUPLICATION
# ... Test objective: The objective is to create a subscription in case of not allowed DUPLICATION.
# ... Pre-conditions: subscription with the same filter and callbackUri exists
# ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v2.7.1
# ... Config ID: Config_prod_VNFM
# ... Applicability: the VNFM does not allow creation of a duplicate subscription resource
# ... Post-Conditions: duplicated subscription is not created
# Post Create subscription - DUPLICATION
# Check HTTP Response Status Code Is 303
# Check HTTP Response Header Contain Link
Create a duplicated Subscription
[Documentation] Test ID: 6.3.4.4.2a
... Test title: Create a duplicated Subscription
... Test objective: The objective is to create a duplicate subscription.
... Pre-conditions: subscription with the same filter and callbackUri exists
... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v2.7.1
... Config ID: Config_prod_VNFM
... Applicability: the VNFM does not allow creation of a duplicate subscription resource
... Post-Conditions: duplicated subscription is not created
Post Create subscription - DUPLICATION
Check HTTP Response Status Code Is 303
Check HTTP Response Header Contain Link
... Applicability:
... Post-Conditions: duplicated subscription is created if the IUT allows duplications, otherwise the duplicated subscription is not created
Post Create subscription
Check Response for duplicated subscription
GET Subscriptions
[Documentation] Test ID: 6.3.4.4.4
......@@ -307,32 +320,32 @@ Post Create subscription
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${template}= Get File jsons/fmSubscriptionRequest.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Post Create subscription - DUPLICATION
Log Trying to create a subscription with an already created content
Pass Execution If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 0 NVFO is not permitting duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${template}= Get File jsons/fmSubscriptionRequest.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Post Create subscription - NO-DUPLICATION
Log Trying to create a subscription with an already created content
Pass Execution If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1 VNFM permits duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${template}= Get File jsons/fmSubscriptionRequest.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
# Post Create subscription - DUPLICATION
# Log Trying to create a subscription with an already created content
# Pass Execution If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 0 NVFO is not permitting duplication. Skipping the test
# Set Headers {"Accept": "${ACCEPT}"}
# Set Headers {"Content-Type": "${CONTENT_TYPE}"}
# Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
# ${template}= Get File jsons/fmSubscriptionRequest.json
# ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
# Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
# ${outputResponse}= Output response
# Set Global Variable ${response} ${outputResponse}
# Post Create subscription - NO-DUPLICATION
# Log Trying to create a subscription with an already created content
# Pass Execution If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1 VNFM permits duplication. Skipping the test
# Set Headers {"Accept": "${ACCEPT}"}
# Set Headers {"Content-Type": "${CONTENT_TYPE}"}
# Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
# ${template}= Get File jsons/fmSubscriptionRequest.json
# ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
# Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
# ${outputResponse}= Output response
# Set Global Variable ${response} ${outputResponse}
Get subscriptions
Log Get the list of active subscriptions
Set Headers {"Accept":"${ACCEPT}"}
......@@ -505,4 +518,9 @@ Check Postcondition resource exists
Integer response status 200
Check Postcondition Duplicate Subscription exsist
Should Not Be Equal As Strings ${response['body']['callbackUri']} ${subscriptionId}
\ No newline at end of file
Should Not Be Equal As Strings ${response['body']['callbackUri']} ${subscriptionId}
Check Response for duplicated subscription
Run Keyword If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1 Check HTTP Response Status Code Is 201
Run Keyword If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1 Check HTTP Response Body Json Schema Is FmSubscription
Run Keyword If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 0 Check HTTP Response Status Code Is 303
......@@ -208,6 +208,6 @@ Check HTTP Response Status Code Is
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
${schema} = Catenate ${input} .schema.json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
\ No newline at end of file
......@@ -207,7 +207,7 @@ Get VNF Indicators Subscriptions with invalid filter
Set Suite Variable ${response} ${output}
Get VNF Indicators Subscriptions with invalid resource endpoint
Log Trying to perform a request on a Uri which doesn't exist
Log Trying to perform a request on a Uri which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscription
......@@ -219,7 +219,7 @@ Send Post Request for VNF Indicator Subscription
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${template}= Get File jsons/subscriptions.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${output}= Output response
......
......@@ -206,6 +206,6 @@ Check HTTP Response Status Code Is
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
${schema} = Catenate ${input} .schema.json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
\ No newline at end of file
......@@ -37,6 +37,7 @@ GET Information about an individual VNF Instance
GET individual vnfInstance
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is vnfInstance
Check HTTP Response Body vnfInstance content against VNF Descriptor
PUT Individual VNFInstance - Method not implemented
[Documentation] Test ID: 6.3.5.2.3
......
......@@ -28,7 +28,8 @@ Get status information about multiple VNF instances
... Post-Conditions: none
Get Individual VNF LCM OP occurrences
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is VnfLcmOpOcc
Check HTTP Response Body Json Schema Is vnfLcmOpOcc
Check HTTP Response Body vnf LCM OpOCC content against VNF Descriptor
PUT status information about multiple VNF instances - Method not implemented
[Documentation] Test ID: 6.3.5.12.3
......
......@@ -17,7 +17,7 @@ POST Scale a vnfInstance
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
POST Scale vnfInstance
POST Scale vnfInstance 0
Check HTTP Response Status Code Is 202
Check Operation Occurrence Id
......@@ -30,7 +30,7 @@ POST Scale a vnfInstance Conflict (Not-Instantiated)
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
POST Scale vnfInstance
POST Scale vnfInstance 1
Check HTTP Response Status Code Is 409
Check HTTP Response Body Json Schema Is ProblemDetails
......@@ -43,7 +43,7 @@ POST Scale a vnfInstance Not Found
... Config ID: Config_prod_VE
... Applicability: none
... Post-Conditions: none
POST Scale vnfInstance
POST Scale vnfInstance 2
Check HTTP Response Status Code Is 404
Check HTTP Response Body Json Schema Is ProblemDetails
......
......@@ -19,6 +19,7 @@ POST Create a new vnfInstance
POST Create a new vnfInstance
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is vnfInstance
Check HTTP Response Body vnfInstance content against VNF Descriptor
GET information about multiple VNF instances
[Documentation] Test ID: 6.3.5.1.2
......@@ -32,8 +33,8 @@ GET information about multiple VNF instances
GET multiple vnfInstances
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is vnfInstances
Check HTTP Response Body vnfInstances content against VNF Descriptor
GET information about multiple VNF instances Bad Request Invalid attribute-based filtering parameters
[Documentation] Test ID: 6.3.5.1.3
... Test title: GET information about multiple VNF instances Bad Request Invalid attribute-based filtering parameters
......
......@@ -10,6 +10,8 @@ Library JSONLibrary
Library Collections
Library JSONSchemaLibrary schemas/
Library String
Variables descriptors/SOL001/VNFD/vnfd_SOL001.yaml
Variables descriptors/SOL006/VNFD/vnfd_SOL006.yaml
*** Keywords ***
......@@ -33,7 +35,7 @@ Check Operation Occurrence Id
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
${schema} = Catenate ${input} .schema.json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
......@@ -75,12 +77,13 @@ Check HTTP Response Header Contains
Log Header is present
POST Create a new vnfInstance
Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances
Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Set Headers {"Authorization":"${AUTHORIZATION}"}
Run Keyword If ${check_descriptors} == 1 PARSE the Descriptor File
${template} = Get File jsons/createVnfRequest.json
${body}= Format String ${template} vnfdId=${vnfdId}
${body}= Format String ${template} vnfdId=${Descriptor_ID}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -202,7 +205,9 @@ PATCH individual vnfInstance
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Set Headers {"If-Match": "${original_etag}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
#Run Keyword If ${check_descriptors} == 1 Add VNF Descriptor Content to VNF Instance
${body}= Get File jsons/patchBodyRequest.json
#${body}= Format String ${template} vnfdId=${descriptor_id}
Patch ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${vnfInstanceId} ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -252,16 +257,38 @@ DELETE instantiate individual vnfInstance
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
POST Scale vnfInstance
POST Scale vnfInstance
[Arguments] ${vnf_state}
[Documentation] ${vnf_state} differentiate the VNF ID to be used in the different POST requests
... ${vnf_state} == 0 -> VNF in instantiated state
... ${vnf_state} == 1 -> VNF in not_instantiated state
... ${vnf_state} == 2 -> VNF ID not stored
...
Log Trying to Instantiate a vnf Instance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${template}= Get File jsons/scaleVnfRequest.json
${body}= Format String ${template} scaleVnfRequesttype=${scaleVnfRequesttype} scaleVnfRequestAspect=${scaleVnfRequestAspect}
${body}= Get File jsons/scaleVnfRequest.json
Run Keyword If ${vnf_state} == 0 Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${instantiatedVnfInstanceId}/scale ${body}
Run Keyword If ${vnf_state} == 1 Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${notInstantiatedVnfInstanceId}/scale ${body}
Run Keyword If ${vnf_state} == 2 Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${NOT_EXISTANT_VNF_INSTANCE_ID}/scale ${body}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/scale ${body}
${outputResponse}= Output response
Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/scale ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
# POST Scale vnfInstance
# Log Trying to Instantiate a vnf Instance
# Set Headers {"Accept":"${ACCEPT}"}
# Set Headers {"Content-Type": "${CONTENT_TYPE}"}
# Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
# ${template}= Get File jsons/scaleVnfRequest.json
# ${body}= Format String ${template} scaleVnfRequesttype=${scaleVnfRequesttype} scaleVnfRequestAspect=${scaleVnfRequestAspect}
# Post ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/scale ${body}
# ${outputResponse}= Output response
# Set Global Variable ${response} ${outputResponse}
GET Scale vnfInstance
Log Trying to get a scale a vnf Instance
Set Headers {"Accept":"${ACCEPT}"}
......@@ -767,7 +794,7 @@ Post Create subscription
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${template}= Get File jsons/lccnSubscriptionRequest.json
${body}= Format String ${template} vnfdIds=${vnfdIds} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
${body}= Format String ${template} vnfdIds=${vnfdIds} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -778,7 +805,7 @@ Post Create subscription - DUPLICATION
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${template}= Get File jsons/lccnSubscriptionRequest.json
${body}= Format String ${template} vnfdIds=${vnfdIds} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
${body}= Format String ${template} vnfdIds=${vnfdIds} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -789,7 +816,7 @@ Post Create subscription - NO-DUPLICATION
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${template}= Get File jsons/lccnSubscriptionRequest.json
${body}= Format String ${template} vnfdIds=${vnfdIds} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
${body}= Format String ${template} vnfdIds=${vnfdIds} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -1015,4 +1042,180 @@ Get VNF LCM Operation occurrences with exclude_fields attribute selector
Check HTTP Response Header Contain Link
${linkURL}= Get Value From Json ${response['headers']} $..Link
Should Not Be Empty ${linkURL}
\ No newline at end of file
Should Not Be Empty ${linkURL}
Check HTTP Response Body vnfInstances content against VNF Descriptor
#{check_multiple_instances} flag, set to 1 to check multiple instances against descriptors
Run Keyword If ${check_multiple_instances} == 1 Check Multiple VNF Instances Content
Check Multiple VNF Instances Content
#${number_of_instances}= Get Length ${response['body']}
#FOR ${i} IN RANGE ${number_of_instances}
${response['body']}= Get Variable Value ${response['body'][0]} #Gets the first instance at index 0
Check Individual VNF Instance Content
#END
Check HTTP Response Body vnfInstance content against VNF Descriptor
#${check_descriptors} flag, 1 to check descriptors
Run Keyword If ${check_descriptors} == 1 Check Individual VNF Instance Content
Check Individual VNF Instance Content
PARSE the Descriptor File
Match the VNF Instance Response Attributes with Descriptors
PARSE the Descriptor File
Run Keyword If '${descriptorType}'=='SOL001' Fetch Information from SOL001 descriptor file ELSE Fetch Information from SOL006 descriptor file
Fetch Information from SOL001 descriptor file
@{VDU_labels}= Create List
@{VNF_labels}= Create List
@{VirtualLink_labels}= Create List
@{CP_labels}= Create List
@{Storage_labels}= Create List
FOR ${key} IN @{topology_template.node_templates.keys()}
${key_type}= Get Variable Value ${topology_template.node_templates.${key}.type}
${VDU_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_VDU_compute}
${VNF_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_VNF}
${Link_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_virtual_link}
${VDUcp_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_VDU_cp}
${Storage_check}= Run Keyword And Return Status Should Be Equal As Strings ${key_type} ${tosca_type_storage}
Run Keyword If ${VDU_check} Append To List ${VDU_labels} ${key}
Run Keyword If ${VNF_check} Append To List ${VNF_labels} ${key}
Run Keyword If ${VNF_check} Get VNF Attributes from SOL001 ${key}
Run Keyword If ${Link_check} Append To List ${VirtualLink_labels} ${key}
Run Keyword If ${VDUcp_check} Append To List ${CP_labels} ${key}
Run Keyword If ${Storage_check} Append To List ${Storage_labels} ${key}
END
Set Global Variable @{VDU_IDs} @{VDU_labels}
Set Global Variable @{VNF_IDs} @{VNF_labels}
Set Global Variable @{VirtualLink_IDs} @{VirtualLink_labels}
Set Global Variable @{CP_IDs} @{CP_labels}
Set Global Variable @{Storage_IDs} @{Storage_labels}
Get VNF Attributes from SOL001
[Arguments] ${VNF_label}
${descriptor_id}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.descriptor_id}
${provider}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.provider}
${product_name}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.product_name}
${software_version}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.software_version}
${descriptor_version}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.descriptor_version}
${flavour_id}= Get Variable Value ${topology_template.node_templates.${VNF_label}.properties.flavour_id}
Set Global Variable ${Descriptor_ID} ${descriptor_id}
Set Global Variable ${Provider} ${provider}
Set Global Variable ${Product_Name} ${product_name}
Set Global Variable ${Software_Version} ${software_version}
Set Global Variable ${Descriptor_Version} ${descriptor_version}
Set Global Variable ${Flavour_ID} ${flavour_id}
Fetch Information from SOL006 descriptor file
${descriptor_id}= Get Variable Value ${nfv.vnfd[0].id}
${provider}= Get Variable Value ${nfv.vnfd[0].provider}
${product_name}= Get Variable Value ${nfv.vnfd[0]['product-name']}
${software_version}= Get Variable Value ${nfv.vnfd[0]['software-version']}
${descriptor_version}= Get Variable Value ${nfv.vnfd[0].version}
${VDUcount}= Get Length ${nfv.vnfd[0].vdu}
${extCP_count}= Get Length ${nfv.vnfd[0]['ext-cpd']}
${virtualLink_count}= Get length ${nfv.vnfd[0]['int-virtual-link-desc']}
${instantiation_levels}= Get Length ${nfv.vnfd[0].df['instantiation-level']}
FOR ${key} IN @{nfv.vnfd[0].keys()}
${VDU_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} vdu
Run Keyword If ${VDU_check} Get VDU IDs ${VDUcount}
${extCP_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} ext-cpd
Run Keyword If ${extCP_check} Get External CP IDs ${extCP_count}
${virtualLink_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} int-virtual-link-desc
Run Keyword If ${virtualLink_check} Get Virtual Link IDs ${virtualLink_count}
${DF_check}= Run Keyword And Return Status Should Be Equal As Strings ${key} df
Run Keyword If ${DF_check} Get Instantiation Levels ${instantiation_levels}
END
Set Global Variable ${Descriptor_ID} ${descriptor_id}
Set Global Variable ${Provider} ${provider}
Set Global Variable ${Product_Name} ${product_name}
Set Global Variable ${Software_Version} ${software_version}
Set Global Variable ${Descriptor_Version} ${descriptor_version}
Get VDU IDs
[Arguments] ${count}
@{VDU_labels}= Create List
${Storage_labels}= Create List
FOR ${i} IN RANGE ${count}
Append To List ${VDU_labels} ${nfv.vnfd[0].vdu[${i}]['id']}
Append To List ${Storage_labels} ${nfv.vnfd[0].vdu[${i}]['virtual-storage-desc']}
Get Internal CPs for each VDU ${i}
END
Set Global Variable ${VDU_IDs} ${VDU_labels}
Set Global Variable ${Storage_IDs} ${Storage_labels}
Get Internal CPs for each VDU
[Arguments] ${vdu}
${count}= Get Length ${nfv.vnfd[0].vdu[${vdu}]['int-cpd']}
${internal_CPs}= Create List
FOR ${i} IN RANGE ${count}
Append To List ${internal_CPs} ${nfv.vnfd[0].vdu[${vdu}]['int-cpd'][${i}]['id']}
END
Set Global Variable ${internalCP_IDs} ${internal_CPs}
Get External CP IDs
[Arguments] ${count}
@{external_CPs}= Create List
FOR ${i} IN RANGE ${count}
Append To List ${external_CPs} ${nfv.vnfd[0]['ext-cpd'][${i}]['id']}
END
Set Global Variable ${externalCP_IDs} ${external_CPs}
Get Virtual Link IDs
[Arguments] ${count}
${VirtualLink_labels}= Create List
FOR ${i} IN RANGE ${count}
Append To List ${VirtualLink_labels} ${nfv.vnfd[0]['int-virtual-link-desc'][${i}]['id']}
END
Set Global Variable ${VirtualLink_IDs} ${VirtualLink_labels}
Get Instantiation Levels
[Arguments] ${count}
@{Instantiation_Levels}= Create List
FOR ${i} IN RANGE ${count}
Append To List ${Instantiation_Levels} ${nfv.vnfd[0].df['instantiation-level'][${i}]['id']}
END
Set Global Variable ${InstantiationLevel_IDs} ${Instantiation_Levels}
Match the VNF Instance Response Attributes with Descriptors
#Checking Response attributes with VNF Descriptors
Should Be Equal As Strings ${response['body']['vnfdId']} ${Descriptor_ID}
Should Be Equal As Strings ${response['body']['vnfProvider']} ${Provider}
Should Be Equal As Strings ${response['body']['vnfProductName']} ${Product_Name}
Should Be Equal As Strings ${response['body']['vnfSoftwareVersion']} ${Software_Version}
Should Be Equal As Strings ${response['body']['vnfdVersion']} ${Descriptor_Version}
Should Be Equal As Strings ${response['body']['instantiatedVnfInfo']['flavourId']} ${Flavour_ID}
List Should Contain Value ${VDU_IDs} ${response['body']['instantiatedVnfInfo']['vnfcResourceInfo'][0]['vduId']}
Run Keyword If '${descriptorType}'=='SOL006' List Should Contain Value ${externalCP_IDs} ${response['body']['instantiatedVnfInfo']['extCpInfo'][0]['cpdId']}
Run Keyword If '${descriptorType}'=='SOL006' List Should Contain Value ${internalCP_IDs} ${response['body']['instantiatedVnfInfo']['vnfcResourceInfo'][0]['vnfcCpInfo'][0]['cpdId']}
Run Keyword If '${descriptorType}'=='SOL001' List Should Contain Value @{CP_IDs} ${response['body']['instantiatedVnfInfo']['extCpInfo'][0]['cpdId']}
Run Keyword If '${descriptorType}'=='SOL001' List Should Contain Value @{CP_IDs} ${response['body']['instantiatedVnfInfo']['vnfcResourceInfo'][0]['vnfcCpInfo'][0]['cpdId']}
List Should Contain value ${Storage_IDs} ${response['body']['instantiatedVnfInfo']['virtualStorageResourceInfo'][0]['virtualStorageDescId']}
List Should Contain Value ${VirtualLink_IDs} ${response['body']['instantiatedVnfInfo']['extManagedVirtualLinkInfo'][0]['vnfVirtualLinkDescId']}
Check HTTP Response Body vnf LCM OpOCCs content against VNF Descriptor
#{check_multiple_instances} flag, set to 1 to check multiple instances against descriptors
Run Keyword If ${check_multiple_instances} == 1 Check Multiple VNF LCM OpOCCs Content
Check Multiple VNF LCM OpOCCs Content
#${number_of_instances}= Get Length ${response['body']}
#FOR ${i} IN RANGE ${number_of_instances}
${response['body']}= Get Variable Value ${response['body'][0]} #Gets the first instance at index 0
Check Individual VNF LCM Operation Occurence Content
#END
Check HTTP Response Body vnf LCM OpOCC content against VNF Descriptor
Run Keyword If ${check_descriptors} == 1 Check Individual VNF LCM Operation Occurence Content
Check Individual VNF LCM Operation Occurence Content
PARSE the Descriptor File
Match the VNF LCM Operation Occurence Response Attributes with Descriptors
Match the VNF LCM Operation Occurence Response Attributes with Descriptors
Should Be Equal As Strings ${response['body']['changedInfo']['vnfdId']} ${Descriptor_ID}
Should Be Equal As Strings ${response['body']['changedInfo']['vnfdVersion']} ${Descriptor_Version}
List Should Contain Value ${VDU_IDs} ${response['body']['resourceChanges']['affectedVnfcs'][0]['vduId']}
List Should Contain value ${Storage_IDs} ${response['body']['resourceChanges']['affectedVirtualStorages'][0]['virtualStorageDescId']}
List Should Contain Value ${VirtualLink_IDs} ${response['body']['resourceChanges']['affectedVirtualLinks'][0]['vnfVirtualLinkDescId']}
......@@ -32,7 +32,8 @@ GET status information about multiple VNF LCM operation occurrences
GET VNF LCM OP occurrences
Check HTTP Response Status Code Is 202
Check HTTP Response Body Json Schema Is VnfLcmOpOccs
Check HTTP Response Body vnf LCM OpOCCs content against VNF Descriptor
GET status information about multiple VNF LCM operation occurrences Bad Request Invalid attribute-based filtering parameters
[Documentation] Test ID: 6.3.5.11.3
... Test title: GET status information about multiple VNF LCM operation occurrences Bad Request Invalid attribute-based filtering parameters
......
tosca_definitions_version: tosca_simple_yaml_1_2
description: "TST010 reference VNF-B"
metadata:
descriptor_id: "VNF-B"
vendor: "ETSI TST WG"