Commit 69c9dcdd authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

tentative update of importing variables for descriptors

parent be03403c
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -8,10 +8,10 @@ Library OperatingSystem
Library    MockServerLibrary
Library    Collections
Library    String
Variables  descriptors/SOL006/VNFD/vnfd_SOL006.yaml
Variables  descriptors/SOL006/NSD/nsd_SOL006.yaml
Variables  descriptors/SOL001/VNFD/vnfd_SOL001.yaml
Variables  descriptors/SOL001/NSD/nsd_SOL001.yaml
#Variables  descriptors/SOL006/VNFD/vnfd_SOL006.yaml
#Variables  descriptors/SOL006/NSD/nsd_SOL006.yaml
#Variables  descriptors/SOL001/VNFD/vnfd_SOL001.yaml
#Variables  descriptors/SOL001/NSD/nsd_SOL001.yaml

*** Keywords ***
Initialize System
@@ -262,6 +262,7 @@ 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
    @{VDU_labels}=    Create List
    @{VNF_labels}=    Create List
    @{VirtualLink_labels}=    Create List
@@ -289,6 +290,7 @@ 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}
@@ -304,6 +306,7 @@ Get VNF Attributes from SOL001
    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']}
@@ -331,6 +334,7 @@ Fetch Information from SOL006 descriptor file

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}
@@ -343,6 +347,7 @@ Get VDU IDs
            
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}
@@ -352,6 +357,7 @@ Get Internal CPs for each VDU
    
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']} 
@@ -360,6 +366,7 @@ Get External CP IDs

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']} 
@@ -368,6 +375,7 @@ Get Virtual Link IDs

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']} 
@@ -1337,6 +1345,7 @@ PARSE the NS Descriptor File
    Run Keyword If  '${descriptorType}'=='SOL001'    Fetch Information from SOL001 NS descriptor file    ELSE    Fetch Information from SOL006 NS descriptor file

Fetch Information from SOL001 NS descriptor file
    Import Variables    ${CURDIR}/descriptors/SOL001/NSD/nsd_SOL001.yaml
    @{NsVirtualLink_labels}=    Create List
    @{NsCP_labels}=    Create List
    FOR    ${key}    IN    @{topology_template.node_templates.keys()} 
@@ -1353,6 +1362,7 @@ Fetch Information from SOL001 NS descriptor file

Get NS Attributes from SOL001
    [Arguments]    ${NS_label}
    Import Variables    ${CURDIR}/descriptors/SOL001/NSD/nsd_SOL001.yaml
    ${ns_descriptor_id}=    Get Variable Value    ${topology_template.node_templates.${NS_label}.properties.descriptorId}
    ${designer}=    Get Variable Value    ${topology_template.node_templates.${NS_label}.properties.designer}
    ${version}=    Get Variable Value    ${topology_template.node_templates.${NS_label}.properties.version}
@@ -1366,6 +1376,7 @@ Get NS Attributes from SOL001
    Set Global Variable    ${NS_InvariantID}    ${invariantId}

Fetch Information from SOL006 NS descriptor file
    Import Variables    ${CURDIR}/descriptors/SOL006/NSD/nsd_SOL006.yaml
    ${nsd_id}=    Get Variable Value    ${nfv.nsd[0].id}
    ${VNFcount}=    Get Length    ${nfv.vnfd}
    ${SAPcount}=    Get Length    ${nfv.nsd[0].sapd}
@@ -1382,6 +1393,7 @@ Fetch Information from SOL006 NS descriptor file
    
Get SAP IDs
    [Arguments]    ${count}
    Import Variables    ${CURDIR}/descriptors/SOL006/NSD/nsd_SOL006.yaml
    @{SAPlabels}=    Create List
    FOR    ${i}    IN RANGE    ${count}
        Append To List    ${SAPlabels}    ${nfv.nsd[0].sapd[${i}]['id']}
@@ -1389,6 +1401,7 @@ Get SAP IDs
    Set Global Variable    ${SAP_IDs}    ${SAPlabels}
    
Get NS Virtual Link IDs
    Import Variables    ${CURDIR}/descriptors/SOL006/NSD/nsd_SOL006.yaml
    [Arguments]    ${count}
    @{NsVirtualLink_labels}=    Create List
    FOR    ${i}    IN RANGE    ${count}