Commit 2e51b6bd authored by Sana Zulfiqar's avatar Sana Zulfiqar
Browse files

Descriptor checks added in 7.3.2.2.2

parent 73e16fb8
Loading
Loading
Loading
Loading
+139 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,8 @@ Library OperatingSystem
Library    JSONLibrary
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    JSONSchemaLibrary    schemas/
Library    REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library    REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Variables    descriptors/SOL001/reference_tst010_vnf_b_2vdu_SOL001.yaml
Variables    descriptors/SOL006/reference_tst010_vnf_b_2vdu_SOL006.yaml
Documentation    This resource represents an individual grant. The client can use this resource to read the grant.
Documentation    This resource represents an individual grant. The client can use this resource to read the grant.
...    It is determined by means outside the scope of the present document, such as configuration or policy,
...    It is determined by means outside the scope of the present document, such as configuration or policy,
...    how long an individual grant is available.
...    how long an individual grant is available.
@@ -33,6 +35,7 @@ GET an individual grant - Successful
    Get individual grant
    Get individual grant
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    grant
    Check HTTP Response Body Json Schema Is    grant
    Check HTTP Response Body grant content against VNF Descriptor
    
    
GET an individual grant - Process ongoing
GET an individual grant - Process ongoing
    [Tags]    no-synchronous-mode
    [Tags]    no-synchronous-mode
@@ -160,3 +163,139 @@ Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    [Arguments]    ${input}
    ${schema} =    Catenate    ${input}    .schema.json
    ${schema} =    Catenate    ${input}    .schema.json
    Validate Json    ${schema}    ${response['body']}
    Validate Json    ${schema}    ${response['body']}
    
Check HTTP Response Body grant content against VNF Descriptor
    Run Keyword If    ${check_descriptors} == 1    Check Individual grant Content
    
Check Individual grant Content    
    PARSE the Descriptor File
    Match the grant 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
    ${Compute_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']}
        Append To List    ${Compute_labels}    ${nfv.vnfd[0].vdu[${i}]['virtual-compute-desc']} 
        Get Internal CPs for each VDU    ${i}   
    END
    Set Global Variable    ${VDU_IDs}    ${VDU_labels}
    Set Global Variable    ${Storage_IDs}    ${Storage_labels}
    Set Global Variable    ${Compute_IDs}    ${Compute_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 grant Response Attributes with Descriptors
    Run Keyword If  '${descriptorType}'=='SOL006'    List Should Contain Value    ${externalCP_IDs}    ${response['body']['Grant']['extVirtualLinks']['extCps']['cpdId']}
    Run Keyword If  '${descriptorType}'=='SOL001'    List Should Contain Value    @{CP_IDs}    ${response['body']['Grant']['extVirtualLinks']['extCps']['cpdId']}
    List Should Contain Value    ${VirtualLink_IDs}    ${response['body']['Grant']['ExtManagedVirtualLinkData']['vnfVirtualLinkDescId']}
    List Should Contain value    ${Compute_IDs}    ${response['body']['Grant']['vimAssets']['computeResourceFlavours']['vnfdVirtualComputeDescId']}
    


    
+45 −45
Original line number Original line Diff line number Diff line
@@ -15,44 +15,6 @@ topology_template:
      virtual_link_right:
      virtual_link_right:
        [right, virtual_link_right]
        [right, virtual_link_right]
  node_templates:
  node_templates:
    VDU-B-1:
      type: "tosca.nodes.nfv.Vdu.Compute"
      properties:
        name: "vdu-b-1-vcd"
        descriptor: "Description of VDU-B-1"
        vdu_profile:
          min_number_of_instances: 1
          max_number_of_instances: 2
      capabilities:
        virtual_compute:
          properties:
            virtual_memory:
              virtual_mem_size: 4096
              numa_enabled: false
            virtual_cpu:
              num_virtual_cpu: 2
      requirements:
        virtual_storage:
        - "vdu-b-1-vsd"
    VDU-B-2:
      type: "tosca.nodes.nfv.Vdu.Compute"
      properties:
        name: "vdu-b-2-vcd"
        descriptor: "Description of VDU-B-2"
        vdu_profile:
          min_number_of_instances: 1
          max_number_of_instances: 4
      capabilities:
        virtual_compute:
          properties:
            virtual_memory:
              virtual_mem_size: 6144
              numa_enabled: false
            virtual_cpu:
              num_virtual_cpu: 2
      requirements:
        virtual_storage:
        - "vdu-b-2-vsd"
    right:
    right:
      type: "tosca.nodes.nfv.VduCp"
      type: "tosca.nodes.nfv.VduCp"
      properties:
      properties:
@@ -75,7 +37,7 @@ topology_template:
        virtual_link_left:
        virtual_link_left:
        virtual_binding: VDU-B-1
        virtual_binding: VDU-B-1
    internal_vl:
    internal_vl:
      type: tosca.nodes.nfv.VnfVirtualLink
      type: "tosca.nodes.nfv.VnfVirtualLink"
      properties:
      properties:
        connectivity_type:
        connectivity_type:
          layer_protocols: [ ipv4 ]
          layer_protocols: [ ipv4 ]
@@ -88,20 +50,20 @@ topology_template:
            root: 10000
            root: 10000
            leaf: 10000
            leaf: 10000
    internal_vdu_b_1_cp:
    internal_vdu_b_1_cp:
      type: tosca.nodes.nfv.VduCp
      type: "tosca.nodes.nfv.VduCp"
      properties:
      properties:
        order: 2
        order: 2
      requirements:
      requirements:
        - virtual_binding: VDU-B-1
        - virtual_binding: VDU-B-1
        - virtual_link: internal_vl
        - virtual_link: internal_vl
    internal_vdu_b_2_cp:
    internal_vdu_b_2_cp:
      type: tosca.nodes.nfv.VduCp
      type: "tosca.nodes.nfv.VduCp"
      properties:
      properties:
        order: 0
        order: 0
      requirements:
      requirements:
        - virtual_binding: VDU-B-2
        - virtual_binding: VDU-B-2
        - virtual_link: internal_vl
        - virtual_link: internal_vl
    vdu-b-1-vsd:
    vdu_b_1_vsd:
      type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage"
      type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage"
      properties:
      properties:
        virtual_block_storage_data:
        virtual_block_storage_data:
@@ -120,16 +82,16 @@ topology_template:
          size: '1'
          size: '1'
      artifacts:
      artifacts:
        sw_image:
        sw_image:
          type: tosca.artifacts.nfv.SwImage
          type: "tosca.artifacts.nfv.SwImage"
          file: vdu-b-1.qcow2
          file: vdu-b-1.qcow2
    vdu-b-1-vsd:
    vdu_b_2_vsd:
      type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage"
      type: "tosca.nodes.nfv.Vdu.VirtualBlockStorage"
      properties:
      properties:
        virtual_block_storage_data:
        virtual_block_storage_data:
          size_of_storage: 20
          size_of_storage: 20
          rdma_enabled: false
          rdma_enabled: false
        sw_image_data:
        sw_image_data:
          name: "vdu-b-1 image"
          name: "vdu-b-2 image"
          version: "1.1"
          version: "1.1"
          checksum: 
          checksum: 
            algorithm: "sha-224"
            algorithm: "sha-224"
@@ -166,3 +128,41 @@ topology_template:
                implementation: terminate-example.yaml
                implementation: terminate-example.yaml
              operate:
              operate:
                implementation: operate-example.yaml
                implementation: operate-example.yaml
    VDU_B_1:
      type: "tosca.nodes.nfv.Vdu.Compute"
      properties:
        name: "vdu-b-1-vcd"
        descriptor: "Description of VDU-B-1"
        vdu_profile:
          min_number_of_instances: 1
          max_number_of_instances: 2
      capabilities:
        virtual_compute:
          properties:
            virtual_memory:
              virtual_mem_size: 4096
              numa_enabled: false
            virtual_cpu:
              num_virtual_cpu: 2
      requirements:
        virtual_storage:
        - "vdu-b-1-vsd"
    VDU_B_2:
      type: "tosca.nodes.nfv.Vdu.Compute"
      properties:
        name: "vdu-b-2-vcd"
        descriptor: "Description of VDU-B-2"
        vdu_profile:
          min_number_of_instances: 1
          max_number_of_instances: 4
      capabilities:
        virtual_compute:
          properties:
            virtual_memory:
              virtual_mem_size: 6144
              numa_enabled: false
            virtual_cpu:
              num_virtual_cpu: 2
      requirements:
        virtual_storage:
        - "vdu-b-2-vsd"                
 No newline at end of file
+137 −0
Original line number Original line Diff line number Diff line
nfv:
nfv:
  vnfd:
  vnfd:
    - id: VNF-B-2df
    - id: VNF-B-2vdu
      provider: ETSI TST WG
      provider: ETSI TST WG
      product-name: TST010 reference VNF-B with 2 DFs
      product-name: TST010 reference VNF-B with 2 VDUs
      software-version: '2.1'
      software-version: '2.2'
      version: '2.1'
      version: '2.2'
      vnfm-info: ETSI VNFM
      vnfm-info: ETSI VNFM
      vdu:
      vdu:
        id: vdu-b-1
        - id: vdu-b-1
          name: VNF-B VDU 1
          name: VNF-B VDU 1
          int-cpd:
          int-cpd:
           - id: left
           - id: left
             layer-protocol: ethernet
             layer-protocol: ethernet
           - id: management
           - id: management
             layer-protocol: ethernet
             layer-protocol: ethernet
          - id: right
           - id: internal
             layer-protocol: ethernet
             layer-protocol: ethernet
             int-virtual-link-desc: internal-vl
          virtual-compute-desc: vdu-b-1-vcd
          virtual-compute-desc: vdu-b-1-vcd
          virtual-storage-desc: vdu-b-1-vsd
          virtual-storage-desc: vdu-b-1-vsd
          sw-image-desc: vdu-b-1-image
          sw-image-desc: vdu-b-1-image
        - id: vdu-b-2
          name: VNF-B VDU 2
          int-cpd:
           - id: right
             layer-protocol: ethernet
           - id: management
             layer-protocol: ethernet
           - id: internal
             layer-protocol: ethernet
             int-virtual-link-desc: internal-vl
          virtual-compute-desc: vdu-b-2-vcd
          virtual-storage-desc: vdu-b-2-vsd
          sw-image-desc: vdu-b-2-image
      virtual-compute-desc:
      virtual-compute-desc:
        id: vdu-b-1-vcd
        id: vdu-b-1-vcd
        virtual-memory:
        virtual-memory:
@@ -42,6 +56,39 @@ nfv:
        min-ram: '2.0'
        min-ram: '2.0'
        size: '1'
        size: '1'
        image: 'http://someurl.com/VNF-B.qcow2'
        image: 'http://someurl.com/VNF-B.qcow2'
      virtual-compute-desc:
        id: vdu-b-2-vcd
        virtual-memory:
          size: '6.0'
        virtual-cpu:
          num-virtual-cpu: '2'
      virtual-storage-desc:
        id: vdu-b-2-vsd
        type-of-storage: root-storage
        size-of-storage: '0'
      sw-image-desc:
        id: vdu-b-2-image
        name: VNF-B-2 image
        version: '1.1'
        checksum:
          algorithm: sha-224
          hash: somehashfortst010
        container-format: bare
        disk-format: qcow2
        min-disk: '1'
        min-ram: '2.0'
        size: '1'
        image: 'http://someurl.com/VNF-B-2.qcow2'
      int-virtual-link-desc:
        - id: internal-vl
          flavour:
            id: internal-vl-flavour
            qos:
              latency: '1'
              packet-delay-variation: '1'
              packet-loss-ratio: '0.05'
          connectivity-type:
            layer-protocol: ethernet     
      ext-cpd:
      ext-cpd:
        - id: ext-b-left
        - id: ext-b-left
          int-cpd:
          int-cpd:
@@ -55,23 +102,30 @@ nfv:
          layer-protocol: ethernet
          layer-protocol: ethernet
        - id: ext-b-right
        - id: ext-b-right
          int-cpd:
          int-cpd:
            vdu-id: vdu-b-1
            vdu-id: vdu-b-2
            cpd: right
            cpd: right
          layer-protocol: ethernet
          layer-protocol: ethernet
      df:
      df:
        - id: small
        id: normal
        vdu-profile:
        vdu-profile:
            id: vdu-b-1
          - id: vdu-b-1
            min-number-of-instances: '1'
            min-number-of-instances: '1'
            max-number-of-instances: '2'
            max-number-of-instances: '2'
          - id: vdu-b-2
            min-number-of-instances: '1'
            max-number-of-instances: '4'          
        instantiation-level:
        instantiation-level:
          - id: double
          - id: double
            vdu-level:
            vdu-level:
                vdu-id: vdu-b-1
              - vdu-id: vdu-b-1
                number-of-instances: '2'
              - vdu-id: vdu-b-2
                number-of-instances: '2'
                number-of-instances: '2'
          - id: single
          - id: single
            vdu-level:
            vdu-level:
                vdu-id: vdu-b-1
              - vdu-id: vdu-b-1
                number-of-instances: '1'
              - vdu-id: vdu-b-2
                number-of-instances: '1'
                number-of-instances: '1'
        default-instantiation-level: single
        default-instantiation-level: single
        lcm-operations-configuration:
        lcm-operations-configuration:
@@ -81,25 +135,3 @@ nfv:
            min-graceful-termination: '1'
            min-graceful-termination: '1'
          operate-vnf-op-config:
          operate-vnf-op-config:
            min-graceful-stop-timeout: '1'
            min-graceful-stop-timeout: '1'
 No newline at end of file
        - id: big
          vdu-profile:
            id: vdu-b-1
            min-number-of-instances: '1'
            max-number-of-instances: '4'
          instantiation-level:
            - id: double
              vdu-level:
                vdu-id: vdu-b-1
                number-of-instances: '2'
            - id: triple
              vdu-level:
                vdu-id: vdu-b-1
                number-of-instances: '3'
          default-instantiation-level: double
          lcm-operations-configuration:
            scale-vnf-to-level-op-config:
              arbitrary-target-levels-supported: 'true'
            terminate-vnf-op-config:
              min-graceful-termination: '1'
            operate-vnf-op-config:
              min-graceful-stop-timeout: '1'
+24 −2
Original line number Original line Diff line number Diff line
@@ -44,5 +44,27 @@ ${vnfdId} myVnF
${flavourId}    string
${flavourId}    string


${descriptorType}    SOL001
${descriptorType}    SOL001
${vnfKey}    {}
${check_descriptors}	1
${check_descriptors}	1

${tosca_type_VDU_compute}    tosca.nodes.nfv.Vdu.Compute
${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
 
@{VDU_IDs}
@{VNF_IDs}
@{virtualLink_IDs}
@{CP_IDs}
@{Storage_IDs}
@{internalCP_IDs}
@{externalCP_IDs}
@{InstantiationLevel_IDs}
@{Compute_IDs

${Descriptor_ID}
${Provider}
${Product_Name}
${Software_Version}
${Descriptor_Version}
${Flavour_ID}
 No newline at end of file