...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 Is201
Check HTTP Response Body Json Schema IsFmSubscription
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
# ... 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
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}== 1Check 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