Commit 40b53f49 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

[test-upd][SOL009][NFV-MANO-LOGM][v5.3.1][NFVSOL(26)000019r3][8.3.4.7.1...

[test-upd][SOL009][NFV-MANO-LOGM][v5.3.1][NFVSOL(26)000019r3][8.3.4.7.1 Test-IDs] implemented support for notification validation as per item 17-2
parent f05699eb
Loading
Loading
Loading
Loading
+37 −2
Original line number Diff line number Diff line
@@ -789,8 +789,8 @@ Check Log Report Available Notification Http POST Request Body notificationType
    [Arguments]    ${type}
    Configure Notification Log Report Available Handler    ${callback_endpoint_fwd}    ${type}
    Wait Until Keyword Succeeds    ${total_polling_time}   ${polling_interval}   Verify Mock Expectation    ${notification_request}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
    #Clear Requests    ${callback_endpoint}
    #Clear Requests    ${callback_endpoint_fwd}

Check Threshold Crossed Notification Http POST Request Body Json Schema Is    
    [Arguments]    ${element}
@@ -820,6 +820,41 @@ Create Sessions for Notifications
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}

Check Log Report Notification Validation
    [Arguments]    ${expected_notification_type}=LogReportAvailableNotification
    ${requests}=    Retrieve Requests    ${callback_endpoint_fwd}
    Should Not Be Empty    ${requests}    msg=No notification received at callback endpoint!

    ${request_type}=    Evaluate    type(${requests})
    Log    Request type: ${request_type}

    ${last_request}=    Run Keyword If    "${request_type}" == "<class 'list'>"
    ...    Get From List    ${requests}    -1
    ...    ELSE
    ...    Set Variable    ${requests}

    ${body}=    Get From Dictionary    ${last_request}    body
    ${body_text}=    Get From Dictionary    ${body}    string

    ${notification}=    Evaluate    json.loads(r'''${body_text}''')    json
    Log    Parsed notification: ${notification}

    Should Be Equal As Strings    ${notification['notificationType']}    ${expected_notification_type}

    ${_links}=    Get From Dictionary    ${notification}    _links

    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Version": "${API_VERSION}"}
    Run Keyword If    ${AUTH_USAGE} == 1
    ...    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}

    # Validate entity exists
    GET    ${_links['logReports'][0]}
    Integer    response status    200

    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}

Check resource existence and get CallbackUri
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"}
+1 −0
Original line number Diff line number Diff line
@@ -16,3 +16,4 @@ Log Report Avaliable Notification
    Trigger the availability of Log Report (external action) 
    Check Log Report Available Notification Http POST Request Body Json Schema Is    LogReportAvailableNotification
    Check Log Report Available Notification Http POST Request Body notificationType attribute Is    LogReportAvailableNotification
    Check Log Report Notification Validation
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ ${CONTENT_TYPE_JSON} application/json
${ACCEPT_JSON}    application/json
${ACCEPT}         application/json
${AUTH_USAGE}     1
${API_VERSION}      1.1.0

${NFVMANO_CHECKS_NOTIF_ENDPOINT}    1        ## If true, during subscription, the FUT performs a get to the notification endpoint