Commit e30362d4 authored by Hammad Zafar's avatar Hammad Zafar
Browse files

fixed VNFD parsing in SOL005 NS LCM API

parent 4f7e84c1
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -264,14 +264,21 @@ 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}
@@ -292,13 +299,14 @@ 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}
+1 −3
Original line number Diff line number Diff line
@@ -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:
+4 −3
Original line number Diff line number Diff line
@@ -82,11 +82,13 @@ ${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
@@ -111,7 +113,6 @@ ${NS_Name}
${NS_Version}
${NS_InvariantId}


${Descriptor_ID}
${Provider}
${Product_Name}
+8 −0
Original line number Diff line number Diff line
@@ -324,6 +324,14 @@ ${NS_InvariantId}
#${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}