Commit 480667a6 authored by Sana Zulfiqar's avatar Sana Zulfiqar
Browse files

Descriptor checks added for 7.3.3.1.1

parent 46830e43
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,7 @@ Resource VNFPackageManagementKeywords.robot
Library           JSONLibrary
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false



*** Test Cases ***
*** Test Cases ***
GET Individual VNF Package
GET Individual VNF Package
    [Documentation]    Test ID: 7.3.3.2.1
    [Documentation]    Test ID: 7.3.3.2.1
+57 −33
Original line number Original line Diff line number Diff line
@@ -9,7 +9,8 @@ Library Collections
Library    JSONSchemaLibrary    schemas/
Library    JSONSchemaLibrary    schemas/
Library    Process
Library    Process
Library    String
Library    String
Variables    descriptors/SOL001/vnf-b-1_VNF.yaml
Variables    descriptors/SOL001/reference_tst010_vnf_b_2vdu_SOL001.yaml
Variables    descriptors/SOL006/reference_tst010_vnf_b_2vdu_SOL006.yaml


*** Keywords ***
*** Keywords ***
Get all VNF Packages
Get all VNF Packages
@@ -1530,42 +1531,65 @@ Check HTTP Response Body of Individual VNF Package content against VNF Descripto
    Run Keyword If    ${check_descriptors} == 1    Check Individual VNF Package Content
    Run Keyword If    ${check_descriptors} == 1    Check Individual VNF Package Content
    
    
Check Individual VNF Package Content
Check Individual VNF Package Content
    Run Keyword If  '${descriptorType}'=='SOL001'  Parse SOL001 VNF Package    ELSE    Parse SOL006 VNF Package    
    PARSE the Descriptor File
    
    Match the VNF Package Response Attributes with Descriptors
Parse SOL001 VNF Package
    
    Get key for VNF Descriptor
PARSE the Descriptor File
    
    Run Keyword If  '${descriptorType}'=='SOL001'    Fetch Information from SOL001 descriptor file    ELSE    Fetch Information from SOL006 descriptor file    
    ${descriptor_id}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.descriptor_id}
    
    ${provider}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.provider}
Fetch Information from SOL001 descriptor file
    ${product_name}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.product_name}
    @{VDU_labels}=    Create List
    ${software_version}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.software_version}
    @{VNF_labels}=    Create List
    ${descriptor_version}=    Get Variable Value    ${topology_template.node_templates.${vnfKey}.properties.descriptor_version}
    @{VirtualLink_labels}=    Create List
    
    @{CP_labels}=    Create List
    Should Be Equal As Strings    ${response['body']['vnfdId']}    ${descriptor_id}
    @{Storage_labels}=    Create List
    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']['vnfSoftwareVesion']}    ${software_version}
    Should Be Equal As Strings    ${response['body']['vnfdVersion']}    ${descriptor_version}
    
Get key for VNF Descriptor
    FOR    ${key}    IN    @{topology_template.node_templates.keys()} 
    FOR    ${key}    IN    @{topology_template.node_templates.keys()} 
        Log    ${key}
        ${key_type}=    Get Variable Value    ${topology_template.node_templates.${key}.type}
        ${check1}=    Run Keyword And Return Status    Should Be Equal As Strings    ${topology_template.node_templates.${key}.type}    tosca.nodes.nfv.VNF
        Run Keyword If     ${check1}     Set Global Variable    ${vnfKey}    ${key}   
    END


Parse SOL006 VNF Package
        ${VNF_check}=    Run Keyword And Return Status    Should Be Equal As Strings    ${key_type}    ${tosca_type_VNF}
        Run Keyword If    ${VNF_check}    Append To List    ${VNF_labels}    ${key}
        Run Keyword If    ${VNF_check}    Get VNF Attributes from SOL001    ${key}            
    END
    Set Global Variable    @{VNF_IDs}    @{VNF_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}
    ${descriptor_id}=    Get Variable Value    ${nfv.vnfd[0].id}
    ${provider}=    Get Variable Value    ${nfv.vnfd[0].provider}
    ${provider}=    Get Variable Value    ${nfv.vnfd[0].provider}
    ${product_name}=    Get Variable Value    ${nfv.vnfd[0].product-name}
    ${product_name}=    Get Variable Value    ${nfv.vnfd[0]['product-name']}
    ${software_version}=    Get Variable Value    ${nfv.vnfd[0].software-version}
    ${software_version}=    Get Variable Value    ${nfv.vnfd[0]['software-version']}
    ${descriptor_version}=    Get Variable Value    ${nfv.vnfd[0].version}    
    ${descriptor_version}=    Get Variable Value    ${nfv.vnfd[0].version}    


    Should Be Equal As Strings    ${response['body']['vnfdId']}    ${descriptor_id}
    Set Global Variable    ${Descriptor_ID}    ${descriptor_id}
    Should Be Equal As Strings    ${response['body']['vnfProvider']}    ${provider}
    Set Global Variable    ${Provider}    ${provider}
    Should Be Equal As Strings    ${response['body']['vnfProductName']}    ${product_name}
    Set Global Variable    ${Product_Name}    ${product_name}
    Should Be Equal As Strings    ${response['body']['vnfSoftwareVesion']}    ${software_version}
    Set Global Variable    ${Software_Version}    ${software_version}
    Should Be Equal As Strings    ${response['body']['vnfdVersion']}    ${descriptor_version}
    Set Global Variable    ${Descriptor_Version}    ${descriptor_version}
    
Match the VNF Package 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']['vnfSoftwareVesion']}    ${Software_Version}
    Should Be Equal As Strings    ${response['body']['vnfdVersion']}    ${Descriptor_Version}

    
    
Check HTTP Response Body of Individual Subscription content against VNF Descriptor
Check HTTP Response Body of Individual Subscription content against VNF Descriptor
    Run Keyword If    ${check_descriptors} == 1    Check Individual VNF Subscription Content
    Run Keyword If    ${check_descriptors} == 1    Check Individual VNF Subscription Content
+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'
+12 −2
Original line number Original line Diff line number Diff line
@@ -90,5 +90,15 @@ ${VAR_SEPERATOR} &
${callbackResp}    localhost
${callbackResp}    localhost


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

${tosca_type_VNF}    tosca.nodes.nfv.VNF
 
@{VNF_IDs}

${Descriptor_ID}
${Provider}
${Product_Name}
${Software_Version}
${Descriptor_Version}
${Flavour_ID}
Loading