Commit 06574d92 authored by Mudassar Khan's avatar Mudassar Khan Committed by Giacomo Bernini
Browse files

add new test cases for resource: Select VNF deployable modules task as per clause 5.4.11b

parent 06a3b836
Loading
Loading
Loading
Loading
+96 −0
Original line number Diff line number Diff line
*** Settings ***
Resource    environment/variables.txt 
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}     ssl_verify=false
Library    OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Resource    VnfLcmOperationKeywords.robot

*** Test Cases ***
POST Select VNF Deployable Module
    [Documentation]    Test ID: 6.3.5.27.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.11b.3.1 - ETSI GS NFV-SOL 002 [2] 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: 6.3.5.27.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.11b.3.1  - ETSI GS NFV-SOL 002 [2] 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: 6.3.5.27.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.11b.3.1  - ETSI GS NFV-SOL 002 [2] 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: 6.3.5.27.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.11b.3.2 - ETSI GS NFV-SOL 002 [2] 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: 6.3.5.27.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.11b.3.3 - ETSI GS NFV-SOL 002 [2] 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: 6.3.5.27.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.11b.3.4 - ETSI GS NFV-SOL 002 [2] 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: 6.3.5.27.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.11b.3.5 - ETSI GS NFV-SOL 002 [2] 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
+77 −0
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ Check HTTP Response Body Json Schema Is
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK



Check resource Instantiated
    Check VNF Instance    ${vnfInstanceId}
    Check HTTP Response Status Code Is    200
@@ -94,6 +96,14 @@ Check HTTP Response Header Contains ETag and Last-Modified
    Should Contain    ${response['headers']}    Last-Modified
    Log    ETag and Last-Modified header are present

Check Individual VNF LCM operation occurrence operationState is
    [Arguments]    ${status}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${opOccResponse}=    Get    ${response['headers']['Location']}
    Log    Validate operationState  
    Should Be Equal as Strings  ${opOccResponse['body']['operationState']}    ${status}
    Log    operationState validated

POST Create a new vnfInstance	
    Log    Create VNF instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_instances
    Set Headers  {"Accept":"${ACCEPT}"}  
@@ -761,6 +771,73 @@ DELETE Change Current VNF Package Task
    ${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}
    
POST Create VNF Snapshot Task
    Log    Trying to request a snapshot of a VNF instance
    Set Headers  {"Accept":"${ACCEPT}"}  
+10 −0
Original line number Diff line number Diff line
{{
  "selectedDeployableModule": ["string"],
  "targetScaleLevelInfo": [
    {
      "aspectId": "string",
      "scaleLevel": 1
    }
  ],
  "additionalParams": {}
}}