Commit c4e4cb98 authored by Eisha Ayaz's avatar Eisha Ayaz
Browse files

[test-upd][SOL003][VNF-FM][v5.4.1][7.3.5.5.x Test-IDs][NFVIFA(26)000116] Add...

[test-upd][SOL003][VNF-FM][v5.4.1][7.3.5.5.x Test-IDs][NFVIFA(26)000116] Add support for verification of authentication header in VNF-FM notification messages as per issue#33 in NFVIFA(26)000116
parent ae0a5e3e
Loading
Loading
Loading
Loading
+10 −0
Changes for SOL003/VNFFaultManagement-API/Notifications.robot: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ Configure Notification Alarm List Rebuilt Handler
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle status notification
    &{req}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{req}=  Update Mock Request Matcher With Headers  ${req}    ${AUTHORIZATION_HEADER}     ${AUTHORIZATION_TOKEN_NOTIF}
    Set Global Variable    ${notification_request}    ${req}
    &{notification_response}=  Create Mock Response    status_code=204
    Create Mock Expectation  ${notification_request}  ${notification_response}
@@ -194,6 +195,7 @@ Configure Notification Alarm Handler
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle status notification
    &{req}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{req}=  Update Mock Request Matcher With Headers  ${req}    ${AUTHORIZATION_HEADER}     ${AUTHORIZATION_TOKEN_NOTIF}
    Set Global Variable    ${notification_request}    ${req}
    &{notification_response}=  Create Mock Response    status_code=204
    Create Mock Expectation  ${notification_request}  ${notification_response}
@@ -205,14 +207,22 @@ Configure Notification Alarm Cleareance Handler
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle status notification
    &{req}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{req}=  Update Mock Request Matcher With Headers  ${req}    ${AUTHORIZATION_HEADER}     ${AUTHORIZATION_TOKEN_NOTIF}
    Set Global Variable    ${notification_request}    ${req}
    &{notification_response}=  Create Mock Response    status_code=204
    Create Mock Expectation  ${notification_request}  ${notification_response}

Update Mock Request Matcher With Headers
    [Arguments]    ${matcher}    ${headerType}    ${headerValue}
    ${hdr}=     Create Dictionary    name=${headerType}    values=${{ [${headerValue}] }}
    Set To Dictionary    ${matcher}    headers=${{ [$hdr] }}
    RETURN    ${matcher}

Configure Notification Forward
    [Arguments]    ${schema}    ${endpoint}    ${endpoint_fwd}    
    Log  Creating mock Http POST forward to handle ${schema}
    &{notification_tmp}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON_SCHEMA"    body=${schema}
    &{notification_tmp}=  Update Mock Request Matcher With Headers  ${notification_tmp}    ${AUTHORIZATION_HEADER}     ${AUTHORIZATION_TOKEN_NOTIF}
    &{notification_fwd}=  Create Mock Http Forward	${endpoint_fwd}
    Create Mock Expectation With Http Forward  ${notification_tmp}  ${notification_fwd}
    
+1 −0
Changes for SOL003/VNFFaultManagement-API/environment/variables.txt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ ${VNFM_PORT} 8080 # Listening port of the VNFM
${VNFM_SCHEMA}    https
${OAUTH_ENCRYPTION_ALGORITHM}  HS256
${AUTHORIZATION_HEADER}    Authorization
${AUTHORIZATION_TOKEN_NOTIF}    Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ98927
${OAUTH_KEY}

${ALARMS_PERMITTED_SCOPE}    vnffm:v1:alarms