Commit 62b58c8d authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

[test-new][SOL025][DATA-ANALYTICS][v5.2.1][12.3.1.6.1 Test-IDs] Implemented...

[test-new][SOL025][DATA-ANALYTICS][v5.2.1][12.3.1.6.1 Test-IDs] Implemented new test for Data Analytics Change Notification delivery
parent bb17e45f
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
*** Settings ***
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt
Library           REST    ${TCDAS_SCHEMA}://${TCDAS_HOST}:${TCDAS_PORT}    ssl_verify=false
Library           OperatingSystem
Library           JSONLibrary
Library           String
Suite Setup       Check resource existence and get CallbackUri

*** Test Cases ***
Data Analytics Change Notification Delivery
    [Documentation]    Test ID: 12.3.1.7.1
    ...    Test title: Data Analytics Change Notification Delivery
    ...    Test objective: The objective is to test that Data Analytics Change Notification is delivered with success to the notification consumer
    ...    Pre-conditions: A subscription for information availability notification is available in the NFV-MANO.
    ...    Reference: clause 5.5.8.2.1 - ETSI GS NFV-SOL 025 [12] v5.2.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post Data Analytics Change Notification
    Check HTTP Response Status Code Is    204
    
*** Keywords ***
Check resource existence and get CallbackUri
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    Integer    response status    200
    Validate Json    response body    AnalyticsSubscription.schema.json
    Set Global Variable    ${callbackResp}    response body callbackUri

Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
    Log    Status code validated 

Post Data Analytics Change Notification
    log    Trying to perform a POST to get notification
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template} =    Get File    jsons/DataAnalyticsChangeNotification.json  
    ${body}=    Format String    ${template}    analyticsId=${analyticsId}
    Post    ${callbackResp}    ${body}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}