Commit b9989217 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Merge branch '5.2.1-dev-IC-tests' into '5.2.1-dev'

Interconnected Test Cases - Implementation for v5.2.1

See merge request !410
parents 924e380e ef7d5f07
Loading
Loading
Loading
Loading
+103 −20
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ GET Individual VNF Package
    ...    Test title: GET Individual VNF Package
    ...    Test objective: The objective is to test the retrieval of an individual VNF package information perform a JSON schema validation of the collected data structure
    ...    Pre-conditions: One or more VNF packages are onboarded in the NFVO.
    ...    Reference: Clause 10.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 10.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -41,7 +41,7 @@ POST Create a new vnfInstance
    ...    Test title: POST Create a new vnfInstance
    ...    Test objective: The objective is to create a new VNF instance resource
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: VNF instance created
@@ -54,7 +54,7 @@ GET information about multiple VNF instances
    ...    Test title: GET information about multiple VNF instances
    ...    Test objective: The objective is to query information about multiple VNF instances
    ...    Pre-conditions:    none
    ...    Reference: Clause 5.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -67,7 +67,7 @@ Get Information about an individual VNF Instance
    ...    Test title: Get Information about an individual VNF Instance
    ...    Test objective: The objective is to create a new VNF instance resource
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.3.3.2 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -82,7 +82,7 @@ DELETE Individual VNFInstance
    ...    Test title: DELETE Individual VNFInstance
    ...    Test objective: The objective is to delete a VNF instance
    ...    Pre-conditions: the VNF instance resource is existing
    ...    Reference: Clause 5.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.3.3.5 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: VNFInstance deleted
@@ -94,7 +94,7 @@ PATCH Individual VNFInstance
    ...    Test title: PATCH Individual VNFInstance
    ...    Test objective: This method modifies an individual VNF instance resource
    ...    Pre-conditions: an existing VNF instance resource
    ...    Reference: Clause 5.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.3.3.4 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: VNFInstance modified
@@ -107,7 +107,7 @@ Instantiate a vnfInstance
    ...    Test title: Post Instantiate Individual VNFInstance
    ...    Test objective: The objective is to instantiate a VNF instance
    ...    Pre-conditions: VNF instance resource is in NOT INSTANTIATED state
    ...    Reference: Clause 5.4.4.4.1 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.4.4.1 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -121,7 +121,7 @@ VNF Instantiation
    ...    Test title: VNF Instantiation workflow
    ...    Test objective: The objective is to test the workflow for the instantiation of a VNF instance
    ...    Pre-conditions: VNF instance resources is already created. NFVO is subscribed to VNF LCM Operation Occurrence notifications 
    ...    Reference: Clause 5.4.4 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.4 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability:  NFVO is able to receive notifications from VNFM
    ...    Post-Conditions: VNF instance in INSTANTIATED state
@@ -139,7 +139,7 @@ POST Terminate a vnfInstance
    ...    Test title: POST Terminate a vnfInstance
    ...    Test objective: The objective is to test that POST method terminate a VNF instance
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.8.3.1 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.8.3.1 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -153,7 +153,7 @@ Terminate a VNF Instance
    ...    Test title: Terminate a VNF Instance
    ...    Test objective: The objective is to terminate a VNF instance.
    ...    Pre-conditions: VNF instance in INSTANTIATED state 
    ...    Reference: Clause 5.3.3 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.3.3 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: NFVO is able to receive notifications from VNFM. 
    ...    Post-Conditions: VNF instance in NOT_INSTANTIATED state 
@@ -171,7 +171,7 @@ GET status information about multiple VNF LCM Operation OCC
    ...    Test title: GET status information about multiple VNF LCM Operation OCC
    ...    Test objective: The objective is to test that GET method retrieve Query status information about multiple VNF lifecycle management operation occurrences.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.12.3.2 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.12.3.2 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none   
@@ -184,7 +184,7 @@ Get Individual VNF LCM Operation occurrence
    ...    Test title: Get Individual VNF LCM Operation occurrences
    ...    Test objective: The objective is to test that this method retrieve information about a VNF lifecycle management operation occurrence 
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.13.3.2 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.13.3.2 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -198,7 +198,7 @@ POST Create a new subscription
    ...    Test title: POST Create a new subscription
    ...    Test objective: The POST method creates a new subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.18.3.1 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.18.3.1 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: in response header Location shall not be null
@@ -211,7 +211,7 @@ GET Subscriptions
    ...    Test title: GET Subscriptions
    ...    Test objective: The objective is Get the list of active subscriptions
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.18.3.2 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.18.3.2 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -224,7 +224,7 @@ GET Individual Subscription
    ...    Test title: GET Individual Subscription
    ...    Test objective: The objective is to test the Get individual subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.19.3.2 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.19.3.2 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -232,12 +232,35 @@ GET Individual Subscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Subscription

VNF LCM Operation Occurrence Notification
    [Documentation]    Test ID: 7.3.1.36.1
    ...    Test title: VNF LCM Operation Occurrence Notification
    ...    Test objective: The objective is to test that the POST request triggers VNF LCM Operation Occurrence Notification.
    ...    Pre-conditions: A subscription for VNF LCM Operation Occurrence notifications is available in the VNFM.
    ...    Reference: Clause 5.4.20.3.1 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post VNF LCM Operation Occurrence Notification
    Check HTTP Response Status Code Is    204

Test the Notification Endpoint - Successful
    [Documentation]    Test ID: 7.3.1.36.4
    ...    Test title: Test the Notification Endpoint - Successful
    ...    Test objective: The objective is to test the Notification Endpoint provided by the notification consumer.
    ...    Pre-conditions: A notification endpoint is provided by the API consumer upon subscription.
    ...    Reference: Clause 5.4.20.3.2 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Get reach the notification endpoint
    Check HTTP Response Status Code Is    204
DELETE an individual subscription
    [Documentation]    Test ID: 7.3.1.18.5
    ...    Test title: DELETE an individual subscription
    ...    Test objective: The objective is to test that the individual subscription is succesfully deleted
    ...    Pre-conditions: none
    ...    Reference: Clause 5.4.19.3.5 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.19.3.5 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: Subscription deleted from VNFM
@@ -263,12 +286,20 @@ VNF Instance Scale Out
    Check Operation Notification For    COMPLETED
    Check Postcondition VNF    SCALE_OUT

VNF Instance Scale Out - will fail
    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    STARTING
    Check Operation Notification For    PROCESSING

Post Retry operation task
    [Documentation]    Test ID: 7.3.1.13.1
    ...    Test title: Post Retry operation task
    ...    Test objective: The objective is to test that POST method The POST method initiates retrying a VNF lifecycle operation if the operation is in FAILED_TEMP state
    ...    Pre-conditions: the "VNF LCM operation occurrence" resource is in "FAILEDGET status information about multiple VNF LCM Operation OCC_TEMP" state.
    ...    Reference: Clause 5.4.14.4.1 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.14.4.1 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -282,7 +313,7 @@ Post Rollback operation task
    ...    Test title: Post Rollback operation task
    ...    Test objective: The objective is to test that POST method initiates rollback on a VNF lifecycle operation
    ...    Pre-conditions: the "VNF LCM operation occurrence" resource is in "FAILED_TEMP" state.
    ...    Reference: Clause 5.4.15.3.1 - ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: Clause 5.4.15.3.1 - ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -334,6 +365,14 @@ VNF Change External Connectivity
    Check Operation Notification For    COMPLETED
    Check Postcondition VNF Change Ext Connectivity

VNF Change External Connectivity - will fail
    Send Change Ext Connectivity Request
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location 
    Check Operation Occurrence Id existence
    Check Operation Notification For    STARTING
    Check Operation Notification For    PROCESSING

Send Change Ext Connectivity Request
    Log    Trying to change the external connectivity of a VNF instance.
    Set Headers  {"Accept":"${ACCEPT}"}  
@@ -867,6 +906,17 @@ Send VNF Scale Out Request
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Send VNF Scale Out Request - will fail
    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}"}
@@ -918,6 +968,17 @@ Check operation resource state is FAILED_TEMP
    ...    Pass Execution If    True    Skipping test: Operation state must be FAILED_TEMP but found ${state}
    Log    Operation resource state is FAILED_TEMP as expected

Check VNF LCM operation is failed
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Sleep    10s
    Get    ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/vnf_lcm_op_occs/${globalVnfLcmOpOccId}
    ${outputResponse}=    Output    response
    ${state}=    Set Variable    ${outputResponse['body']['instantiationState']}
    Log    Current operation state: ${state}
    Run Keyword If    "${state}" != "FAILED_TEMP" and "${state}" != "FAILED"
    ...    Pass Execution If    True    Skipping test: Operation state must be failed but found ${state}
    Log    Operation resource state is failed as expected

Post Retry operation
    Log    Retry a VNF lifecycle operation if that operation has experienced a temporary failure
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
@@ -933,3 +994,25 @@ Post Rollback operation
    Post     ${VNFM_API_ROOT}/${VNFM_API_NAME}/${VNFM_API_MAJOR_VERSION}/vnf_lcm_op_occs/${globalVnfLcmOpOccId}/rollback
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Post VNF LCM Operation Occurrence Notification
    log    Trying to perform a POST to get notification
    Set Headers  {"Accept":"${ACCEPT}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Log  Creating mock request and response to handle POST operation on notification endpoint
    ${req1}=    Configure Notification Forward    VnfLcmOpOccs    ${callback_endpoint}    ${callback_endpoint_fwd}
    ${req2}=    Configure Notification Status Handler    ${callback_endpoint_fwd}    ${notificationStatus}
	Log    Verify notification endpoint is tested
    Wait Until Keyword Succeeds    30 sec   3 sec   Verify Mock Expectation    ${req2}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}

GET reach the notification endpoint  
    Log    Trying to reach the notification endpoint using GET method.
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${callback_uri}:${callback_port}/${callback_endpoint}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}    
    
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
*** Settings ***
Resource        environment/variables.txt
Resource        IC_TC_Keywords.robot
Library         JSONLibrary

*** Test Cases ***

Create a new subscription and verify notification is generated
        [Documentation]         Test ID: 11.3.1.15.1
        ...     Test title: Create a new subscription and verify notification is generated
        ...     Test objective: The objective is to test the interconnected case of subscription resource creation and validation of generation of notification based on the issued filter
        ...     Pre-conditions: None
        ...     Reference: ETSI GS NFV-SOL 003 [1] v5.2.1
        ...     Config ID: Config_prod_NFVO, Config_prod_VNFM
        ...     Applicability: None
        ...     Post-conditions: None
        GET Individual VNF Package
        POST Create a new subscription
        GET Subscriptions
        GET Individual Subscription
        VNF LCM Operation Occurrence Notification
        Test the Notification Endpoint - Successful
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ Create a new subscription and query information about multiple and individual su
        ...     Test title: Create a new subscription and query information about multiple and individual subscription resources
        ...     Test objective: The objective is to test the interconnected case of subscription resource creation and query multiple and individual resources
        ...     Pre-conditions: None
        ...     Reference: ETSI GS NFV-SOL 003 [1] v5.1.1
        ...     Reference: ETSI GS NFV-SOL 003 [1] v5.2.1
        ...     Config ID: Config_prod_NFVO, Config_prod_VNFM
        ...     Applicability: None
        ...     Post-conditions: None
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ Delete individual subscription
    ...    Test title: Delete individual subscription
    ...    Test objective: The objective is to test the interconnected case of subscription resource creation and deletion
    ...    Pre-conditions: none
    ...    Reference: ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_NFVO, Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: Subscription deleted from VNFM
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ VNF instance Change External Connectivity
    ...    Test title: VNF instance Change External Connectivity
    ...    Test objective: The objective is to test the interconnected case of VNF instance resource creation, instantiation and change external connectivity
    ...    Pre-conditions: none
    ...    Reference: ETSI GS NFV-SOL 003 [1] v5.1.1
    ...    Reference: ETSI GS NFV-SOL 003 [1] v5.2.1
    ...    Config ID: Config_prod_NFVO, Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
Loading