Commit 94a29637 authored by uihassan's avatar uihassan
Browse files

descriptors templating for 7.3.1.1.1 added

parent bede9ed1
Loading
Loading
Loading
Loading
+29 −9
Original line number Diff line number Diff line
@@ -124,7 +124,16 @@ Send VNF Instance Resource Create Request
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/createVnfRequest.json
    Get key for VNF Descriptor
    ${descriptor_id}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.descriptor_id}
    ${provider}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.provider}
    ${product_name}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.product_name}
    ${software_version}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.software_version}
    ${descriptor_version}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.descriptor_version}
    ${configurable_properties}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.configurable_properties}
    ${flavour_id}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.flavour_id}
    ${template}=    Get File    jsons/createVnfRequest.json
    ${body}=        Format String   ${template}     vnfdId=${descriptor_id}    vnfProvider=${provider}    vnfProductName=${product_name}    vnfSoftwareVersion=${software_version}    vnfdVersion= ${descriptor_version}    vnfConfigurableProperties=${configurable_properties}    flavourId=${flavour_id}
    ${response}=    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances    ${body}

Send VNF Instance Resource Delete Request
@@ -361,8 +370,16 @@ POST Create a new vnfInstance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get key for VNF Descriptor
    ${descriptor_id}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.descriptor_id}
    ${provider}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.provider}
    ${product_name}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.product_name}
    ${software_version}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.software_version}
    ${descriptor_version}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.descriptor_version}
    ${configurable_properties}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.configurable_properties}
    ${flavour_id}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.flavour_id}
    ${template}=    Get File    jsons/createVnfRequest.json
    ${body}=        Format String   ${template}     vnfdId=${vnfdId} 
    ${body}=        Format String   ${template}     vnfdId=${descriptor_id}    vnfProvider=${provider}    vnfProductName=${product_name}    vnfSoftwareVersion=${software_version}    vnfdVersion= ${descriptor_version}    vnfConfigurableProperties=${configurable_properties}    flavourId=${flavour_id}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 	
@@ -1186,11 +1203,7 @@ Check HTTP Response Body vnfInstance content against VNF Descriptor
    Run Keyword If  '${descriptorType}'=='SOL001'  Parse SOL001    ELSE    Parse SOL006
    
Parse SOL001
    FOR    ${key}    IN    @{topology_template.node_templates.keys()} 
        Log    ${key}
        ${check1}=    Run Keyword And Return Status    Should End With    ${key}    VNF
        Run Keyword If     ${check1}     Set Global Variable    ${vnfKey}    ${key}   
    END
    Get key for VNF Descriptor
    
    ${descriptor_id}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.descriptor_id}
    ${provider}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.provider}
@@ -1206,7 +1219,14 @@ Parse SOL001
    Should Be Equal As Strings    ${response['body']['vnfSoftwareVesion']}    ${software_version}
    Should Be Equal As Strings    ${response['body']['vnfdVersion']}    ${descriptor_version}
    Should Be Equal As Strings    ${response['body']['vnfConfigurableProperties']}    ${configurable_properties}
    Should Be Equal As Strings    ${response['body']['flavourId']}    ${flavour_id}
    Should Be Equal As Strings    ${response['body']['instantiatedVnfInfo']['flavourId']}    ${flavour_id}
    
Parse SOL006
    Log    SOL006 code
    
Get key for VNF Descriptor
    FOR    ${key}    IN    @{topology_template.node_templates.keys()} 
        Log    ${key}
        ${check1}=    Run Keyword And Return Status    Should End With    ${key}    VNF
        Run Keyword If     ${check1}     Set Global Variable    ${vnfKey}    ${key}   
    END
 No newline at end of file
+10 −1
Original line number Diff line number Diff line
{{
  "vnfdId": "{vnfdId}",
  "vnfInstanceName": "string",
  "vnfInstanceDescription": "string",
  "vnfdId": "{vnfdId}",
  "vnfProvider":"{vnfProvider}",
  "vnfProductName":"{vnfProductName}",
  "vnfSoftwareVersion":"{vnfSoftwareVersion}",
  "vnfdVersion":"{vnfdVersion}",
  "vnfConfigurableProperties":"{vnfConfigurableProperties}",
  "instantiatedVnfInfo":{{
  	"flavourId":"{flavourId}",
  	"vnfState":"STARTED"
  }}
  "metadata":{{}}
}}
 No newline at end of file