Commit a2247eb9 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for PNFD archive artifact

parent cfe3d2fa
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -171,3 +171,28 @@ DELETE Individual PNFD Archive Artifact - Method not implemented
    Send DELETE Request for Individual PNFD Archive Artifact
    Check HTTP Response Status Code Is    405

GET Individual PNFD Archive Artifact with permitted authorization scope
    [Documentation]    Test ID: 5.3.1.17.13
    ...    Test title: GET Individual PNFD Archive Artifact with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual PNFD Archive artifact with permitted authorization scope
    ...    Pre-conditions: One or more PNFD archives are on-boarded in the NFVO.
    ...    Reference: Clause 5.4.7c.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual PNFD Archive Artifact with permitted authorization scope
    Check HTTP Response Status Code Is    200

GET Individual PNFD Archive Artifact with not permitted authorization scope
    [Documentation]    Test ID: 5.3.1.17.14
    ...    Test title: GET Individual PNFD Archive Artifact with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval of an individual PNFD Archive artifact fails when using not permitted authorization scope
    ...    Pre-conditions: One or more PNFD archives are on-boarded in the NFVO.
    ...    Reference: Clause 5.4.7c.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual PNFD Archive Artifact with not permitted authorization scope
    Check HTTP Response Status Code Is    200

    
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
@@ -1625,6 +1625,26 @@ GET Individual PNFD Archive Artifact
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual PNFD Archive Artifact with permitted authorization scope
    Log    Trying to get a PNFD Archive Artifact
    ${scopeValue}=    Create Dictionary    scope=${PNFD_ARTIFACTS_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    REST.GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pnf_descriptors/${pnfdInfoId}/artifacts/${pnfd_artifactPath}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual PNFD Archive Artifact with not permitted authorization scope
    Log    Trying to get a PNFD Archive Artifact
    ${scopeValue}=    Create Dictionary    scope=${NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    REST.GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pnf_descriptors/${pnfdInfoId}/artifacts/${pnfd_artifactPath}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
GET Individual PNFD Archive Artifact with include_signatures parameter
    Log    Trying to get PNFD Archive Artifact with security certificates
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ ${PNFD_NOT_PERMITTED_SCOPE} nsd:v2:pnf_descriptors:readonly
${PNFD_ARCHIVE_PERMITTED_SCOPE}    nsd:v2:pnfd_archive_content
${PNFD_ARCHIVE_NOT_PERMITTED_SCOPE}    nsd:v2:pnfd_archive_content:readonly
${PNFF_PERMITTED_SCOPE}    nsd:v2:pnfd:readonly
${PNF_MANIFEST_PERMITTED_SCOPE}    nsd:v2:pnfd:readonly
${PNFD_MANIFEST_PERMITTED_SCOPE}    nsd:v2:pnfd:readonly
${PNFD_ARTIFACTS_PERMITTED_SCOPE}    nsd:<vn>:pnfd_artifacts:readonly 
${NOT_PERMITTED_SCOPE}    nfvmanologm:v2:nvalid