Skip to content
ChangeVNFFlavourTask.robot 6.74 KiB
Newer Older
mengxuan.zhao's avatar
mengxuan.zhao committed
*** Settings ***
Resource    environment/configuration.txt
Resource    environment/variables.txt 
Library    REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} 
aureliano sinatra's avatar
aureliano sinatra committed
Resource    VnfLcmMntOperationKeywords.robot
Library     OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
mengxuan.zhao's avatar
mengxuan.zhao committed

*** Test Cases ***
aureliano sinatra's avatar
aureliano sinatra committed
POST Change deployment flavour of a vnfInstance
    [Documentation]    Test ID: 7.3.1.6.1
    ...    Test title: POST Change deployment flavour of a vnfInstance
    ...    Test objective: The objective is to test that POST method trigger a change in VNF deployment flavour
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Pre-conditions: VNF instance resource is not in NOT-INSTANTIATED state
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Reference:  section 5.4.7.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: in response header Location shall not be null  
    POST Change VNF deployment flavour   
aureliano sinatra's avatar
aureliano sinatra committed
    Check HTTP Response Status Code Is    202
aureliano sinatra's avatar
aureliano sinatra committed
    Check Operation Occurrence Id existence
mengxuan.zhao's avatar
mengxuan.zhao committed

aureliano sinatra's avatar
aureliano sinatra committed
POST Change deployment flavour of a vnfInstance Conflict (Not-Instantiated)
aureliano sinatra's avatar
aureliano sinatra committed
    [Documentation]    Test ID: 7.3.1.6.2
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test title: POST Change deployment flavour of a vnfInstance Conflict (Not-Instantiated)
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test objective: The objective is to test that POST method can't trigger a change in VNF deployment flavour because of a conflict with the state of the VNF instance resource. (VNF instance resource is not in NOT-INSTANTIATED state)
    ...    Pre-conditions: VNF instance resource is in NOT-INSTANTIATED state
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Reference:  section 5.4.7.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none  
    POST Change VNF deployment flavour   
aureliano sinatra's avatar
aureliano sinatra committed
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
aureliano sinatra's avatar
aureliano sinatra committed
POST Change deployment flavour of a vnfInstance Not Found
mengxuan.zhao's avatar
mengxuan.zhao committed
    # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
aureliano sinatra's avatar
aureliano sinatra committed
    [Documentation]    Test ID: 7.3.1.6.3
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test title: POST Change deployment flavour of a vnfInstance Not Found
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test objective: The objective is to test that POST method can't trigger a change in VNF deployment flavour because the VNF instance resource is not found. 
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Pre-conditions: the VNF instance resource is not existing
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Reference:  section 5.4.7.3.1 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none  
    POST Change VNF deployment flavour  
aureliano sinatra's avatar
aureliano sinatra committed
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails
mengxuan.zhao's avatar
mengxuan.zhao committed
   
    
GET Change deployment flavour VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
    [Documentation]    Test ID: 7.3.1.16.4
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test title: GET Change deployment flavour VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test objective: The objective is to test that GET method is not implemented
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.7.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    GET Change VNF deployment flavour   
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed

PUT Change deployment flavour VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
    [Documentation]    Test ID: 7.3.1.16.5
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test title: PUT Change deployment flavour VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.7.3.3 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    PUT Change VNF deployment flavour   
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed

PATCH Change deployment flavour VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
    [Documentation]    Test ID: 7.3.1.16.6
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test title: PATCH Change deployment flavour VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.7.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    PATCH Change VNF deployment flavour   
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed
    
DELETE Change deployment flavour VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
    [Documentation]    Test ID: 7.3.1.16.7
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test title: DELETE Change deployment flavour VNFInstance - Method not implemented
aureliano sinatra's avatar
aureliano sinatra committed
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference:  section 5.4.7.3.5 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    DELETE Change VNF deployment flavour   
    Check HTTP Response Status Code Is    405
mengxuan.zhao's avatar
mengxuan.zhao committed

mengxuan.zhao's avatar
mengxuan.zhao committed
Check resource existance
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} 
    Integer    response status    200

Check resource not instantiated
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} 
    String    response body instantiationState    NOT_INSTANTIATED

aureliano sinatra's avatar
aureliano sinatra committed
Check resource instantiated
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId} 
    String    response body instantiationState    INSTANTIATED    

mengxuan.zhao's avatar
mengxuan.zhao committed
Check change flavour not supported
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} 
    # how to check if change floavour is not supported? "flavourId" doesn't exist?

Launch another LCM operation
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
Elian Kraja's avatar
Elian Kraja committed
    ${body}=    Get File    jsons/scaleVnfRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale    ${body}
mengxuan.zhao's avatar
mengxuan.zhao committed
    Integer    response status    202