Commit 75fdd97d authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

added interconnected test case for vnf instance scale out test id 11.3.9

parent 0128f7e8
Loading
Loading
Loading
Loading
+85 −1
Original line number Diff line number Diff line
@@ -245,6 +245,34 @@ DELETE an individual subscription
	Check HTTP Response Status Code Is    204
    Check Postcondition Subscription Resource is Deleted

VNF Instance Scale Out
    [Documentation]    Test ID: 7.3.1.32.1
    ...    Test title: VNF Instance Scale Out workflow
    ...    Test objective: The objective is to test the workflow for the scaling out a VNF instance
    ...    Pre-conditions: VNF instance in INSTANTIATED state (Test ID 5.4.4.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID 5.4.20.1)
    ...    Reference: Clause 5.4.5 - ETSI GS NFV-SOL 003 [1] v4.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability:  NFVO is able to receive notifications from VNFM. Scale operation is supported for the VNF (as capability in the VNFD)
    ...    Post-Conditions: VNF instance still in INSTANTIATED state and VNF is scaled out
    Send VNF Scale Out Request
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location 
    Check Operation Occurrence Id existence
    Check Operation Notification For Scale   STARTING
    Check Operation Notification For Scale    PROCESSING
    Check Operation Notification For Scale    COMPLETED
    Check Postcondition VNF    SCALE_OUT

VNF Instance Scale In
    Send VNF Scale In Request
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location 
    Check Operation Occurrence Id existence
    Check Operation Notification For Scale   STARTING
    Check Operation Notification For Scale    PROCESSING
    Check Operation Notification For Scale    COMPLETED
    Check Postcondition VNF    SCALE_IN

GET Individual VNF Package [keyword]
    Log    Trying to get a VNF Package present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -736,3 +764,59 @@ Check Postcondition Subscription Resource Is Deleted
    Get Individual subscription [keyword] 
    Integer    response status    404
    Log    Subscription Resource deleted

Send VNF Scale Out Request
    Log    Trying to scale a 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/scaleVnfRequest.json
    ${body}=        Format String   ${template}     scaletype=${scaleOutType}    scaleAspectId=${scaleAspectId}
    Post    ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/vnf_instances/${vnfid}/scale    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Send VNF Scale In Request
    Log    Trying to scale a 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/scaleVnfRequest.json
    ${body}=        Format String   ${template}     scaletype=${scaleInType}    scaleAspectId=${scaleAspectId}
    Post    ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/vnf_instances/${vnfid}/scale    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Check Postcondition VNF
    [Arguments]    ${operation}
    Check resource instantiated
    ${newScaleInfo}=    Get Vnf Scale Info    ${vnfInstanceId}
    Compare ScaleInfos    ${operation}    ${scaleInfo}    ${newScaleInfo}

Compare ScaleInfos
    [Arguments]    ${type}    ${old_scaleinfo}    ${new_scaleinfo}
    FOR    ${element}    IN    ${old_scaleinfo}
        ${old_level}=    Set Variable If    ${element.aspectId}==${aspectId}   ${element.scaleLevel}
        ${old_level_value}=    Convert To Integer    ${old_level}
    END
    FOR    ${element}    IN    ${new_scaleinfo}
        ${new_level}=    Set Variable If    ${element.aspectId}==${aspectId}   ${element.scaleLevel}
        ${new_level_value}=    Convert To Integer    ${new_level}
    END
    Run Keyword If    ${type}==SCALE_OUT    Should Be True    ${old_level_value}<${new_level_value}
    ...    ELSE    Should Be True    ${old_level_value}<${new_level_value}
    
Check Operation Notification For Scale
    [Arguments]    ${status}
    Check Operation Notification    VnfLcmOperationOccurrenceNotification   ${status}

Check resource Instantiated
    Check VNF Instance    ${vnfid}
    Check HTTP Response Status Code Is    200
    Check VNF Status    ${response['body']['instantiationState']}    INSTANTIATED

Get Vnf Scale Info
    [Arguments]    ${vnfInstanceId}
    ${vnfInstance}=    Check VNF Instance    ${vnfid}
    ${scaleInfo}=    Get Value From Json    ${vnfInstance}    $..scaleStatus
    [Return]   ${scaleInfo} 
 No newline at end of file
+21 −0
Original line number Diff line number Diff line
*** Settings ***
Suite Setup       Initialize System
Suite Teardown    Terminate All Processes    kill=true
Resource          environment/variables.txt    # Generic Parameters
Resource          IC_TC_keywords.robot
Library           JSONLibrary

*** Test Cases ***
Scale Out a VNF instance
    [Documentation]    Test ID: 11.3.4
    ...    Test title: Scale Out a VNF instance
    ...    Test objective: The objective is to test the interconnected case of VNF instance resource creation, instantiation and scale out
    ...    Pre-conditions: none
    ...    Reference: ETSI GS NFV-SOL 003 [1] v4.5.1
    ...    Config ID: Config_prod_NFVO, Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual VNF Package
    POST Create a new vnfInstance
    VNF Instantiation
    VNF Instance Scale Out
+2 −0
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ ${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.
${vnfdId}         VNF-B
${vnfdId_notInEnabledState}    vnfdId-which-is-not-in-ENABLED-state-or-DNE
${scaletype}      SCALE_OUT
${scaleOutType}      SCALE_OUT
${scaleInType}      SCALE_IN
${scaleAspectId}    myAspect
${instantiationLevelId}    myNextLevel
${newFlavourId}    myFlavour_new