Commit f4145920 authored by Muhammad Umair Khan's avatar Muhammad Umair Khan Committed by Giacomo Bernini
Browse files

Add new test cases for resource: Select VNF deployable modules task as per clause 5.4.26

parent 2b63b3fa
Loading
Loading
Loading
Loading
+98 −0
Original line number Diff line number Diff line
*** Settings ***
Resource          environment/variables.txt
Resource          VnfLcmMntOperationKeywords.robot
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           OperatingSystem
Library           BuiltIn
Library           Collections
Library           JSONLibrary
Library           Process

*** Test Cases ***
POST Select VNF Deployable Module
    [Documentation]    Test ID: 7.3.1.43.1
    ...    Test title: POST Select VNF Deployable Module
    ...    Test objective: The objective is to select VNF Deployable Module
    ...    Pre-conditions: The VNF instance resource is in INSTANTIATED state
    ...    Reference: Clause 5.4.26.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Select VNF Deployable Modules
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check Individual VNF LCM operation occurrence operationState is    STARTING

POST Select VNF Deployable Module Not Found
    [Documentation]    Test ID: 7.3.1.43.2
    ...    Test title: POST Select VNF Deployable Module Not Found
    ...    Test objective: The objective is to test that the POST Select VNF Deployable Module fails when the resource is not present.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.26.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Select VNF Deployable Modules Not Existing
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails

POST Select VNF Deployable Module with conflict (Not Instantiated)
    [Documentation]    Test ID: 7.3.1.43.3
    ...    Test title: POST Operate a vnfInstance Conflict (Not-Instantiated)
    ...    Test objective: The objective is to test that the operation fails when there is a conflict with the resource state.
    ...    Pre-conditions: the VNF instance resource is in NOT-INSTANTIATED state
    ...    Reference: Clause 5.4.26.3.1 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Select VNF Deployable Modules with conflict
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails

GET Select VNF Deployable Module - Method not implemented
    [Documentation]    Test ID: 7.3.1.43.4
    ...    Test title: GET Select VNF Deployable Module - Method not implemented
    ...    Test objective: The objective is to verify that the method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.26.3.2 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Select VNF Deployable Modules
    Check HTTP Response Status Code Is    405

PUT Select VNF Deployable Module - Method not implemented
    [Documentation]    Test ID: 7.3.1.43.5
    ...    Test title: PUT Select VNF Deployable Module - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.26.3.3 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    PUT Select VNF Deployable Modules
    Check HTTP Response Status Code Is    405

PATCH Select VNF Deployable Module - Method Not implemented
    [Documentation]    Test ID: 7.3.1.43.6
    ...    Test title: PATCH Select VNF Deployable Module - Method Not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.26.3.4 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    PATCH Select VNF Deployable Modules
    Check HTTP Response Status Code Is    405

DELETE Select VNF Deployable Module - Method Not implemented
    [Documentation]    Test ID: 7.3.1.43.7
    ...    Test title: DELETE Select VNF Deployable Module - Method Not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.26.3.5 - ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    DELETE Select VNF Deployable Modules
    Check HTTP Response Status Code Is    405
 No newline at end of file
+68 −0
Original line number Diff line number Diff line
@@ -2133,6 +2133,74 @@ DELETE VNF State Snapshot
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

POST Select VNF Deployable Modules
    log    Trying to select deployable modules of VNF instance
    Set Headers    {"Accept":"${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/SelectVnfDeployableModulesRequest.json
    ${body}=    Format String    ${template}
    Post    ${apiRoot}/vnflcm/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/select_depl_mods    ${body}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

POST Select VNF Deployable Modules Not Existing
    log    Trying to select deployable modules of VNF instance
    Set Headers    {"Accept":"${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/SelectVnfDeployableModulesRequest.json
    ${body}=    Format String    ${template}
    Post    ${apiRoot}/vnflcm/${apiMajorVersion}/vnf_instances/${notExistingVnfInstanceId}/select_depl_mods    ${body}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

POST Select VNF Deployable Modules with conflict
    log    Trying to select deployable modules of VNF instance.
    Set Headers    {"Accept":"${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/SelectVnfDeployableModulesRequest.json
    ${body}=    Format String    ${template}
    Post    ${apiRoot}/vnflcm/${apiMajorVersion}/vnf_instances/${notInstantiatedVnfInstanceId}/select_depl_mods    ${body}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}


GET Select VNF Deployable Modules
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} 
    Get    ${apiRoot}/vnflcm/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/select_depl_mods
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

PUT Select VNF Deployable Modules
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers    {"Accept":"${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Put    ${apiRoot}/vnflcm/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/select_depl_mods
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

PATCH Select VNF Deployable Modules
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers    {"Accept":"${ACCEPT}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${apiRoot}/vnflcm/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/select_depl_mods
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}

DELETE Select VNF Deployable Modules
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers    {"Accept":"${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Delete    ${apiRoot}/vnflcm/${apiMajorVersion}/vnf_instances/${vnfInstanceId}/select_depl_mods
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}


Check HTTP Content-Type Header Is Set
    Log    Check Content-Type HTTP Header
    Should Contain    ${response['headers']}    Content-Type
+10 −0
Original line number Diff line number Diff line
{{
  "selectedDeployableModule": ["string"],
  "targetScaleLevelInfo": [
    {
      "aspectId": "{string}",
      "scaleLevel": 1
    }
  ],
  "additionalParams": {}
}}