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

[test-upd][SOL003][VNF-PKGMGMT][v5.4.1][7.3.3.8.x Test-IDs][NFVIFA(26)000116]...

[test-upd][SOL003][VNF-PKGMGMT][v5.4.1][7.3.3.8.x Test-IDs][NFVIFA(26)000116] Add support for verification of authentication header in VNF-PKGMGMT notification messages as per issue#33 in NFVIFA(26)000116
parent d31166dd
Loading
Loading
Loading
Loading
+10 −0
Changes for SOL003/VNFPackageManagement-API/Notifications.robot: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ Configure Notification Onboarding 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}
@@ -180,6 +181,7 @@ Configure Notification Delete 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}
@@ -191,14 +193,22 @@ Configure Notification Change Status 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/VNFPackageManagement-API/environment/variables.txt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ ${NFVO_SCHEMA} https

${OAUTH_ENCRYPTION_ALGORITHM}  HS256
${AUTHORIZATION_HEADER}    Authorization
${AUTHORIZATION_TOKEN_NOTIF}    Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ98927
${OAUTH_KEY}

${VNF_PACKAGE_INFO_READONLY_PERMITTED_SCOPE}    vnfpkgm:v1:vnf_package_info:readonly