Commit 41fb88a0 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for VNF Pkg content individual artifacts

parent 40e538f6
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -142,3 +142,27 @@ DELETE Individual VNF Package Artifact - Method not implemented
    ...    Post-Conditions: none
    Send DELETE Request for individual VNF Package Artifact
    Check HTTP Response Status Code Is    405

GET Individual VNF Package Artifact with permitted authorization scope
    [Documentation]    Test ID: 5.3.5.6.1
    ...    Test title: GET Individual VNF Package Artifact with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual VNF package artifact with permitted authorization scope
    ...    Pre-conditions: One or more VNF packages are onboarded in the NFVO.
    ...    Reference: Clause 9.4.7.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual VNF Package Artifact with permitted authorization scope
    Check HTTP Response Status Code Is    200

GET Individual VNF Package Artifact with not permitted authorization scope
    [Documentation]    Test ID: 5.3.5.6.1
    ...    Test title: GET Individual VNF Package Artifact with not permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual VNF package artifact fails when using not permitted authorization scope
    ...    Pre-conditions: One or more VNF packages are onboarded in the NFVO.
    ...    Reference: Clause 9.4.7.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual VNF Package Artifact with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
@@ -772,6 +772,26 @@ GET Individual VNF Package Artifact
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual VNF Package Artifact with permitted authorization scope
    Log    Trying to get a VNF Package Artifact
    ${scopeValue}=    Create Dictionary    scope=${ARTIFACT_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}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual VNF Package Artifact with not permitted authorization scope
    Log    Trying to get a VNF Package 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}/vnf_packages/${vnfPackageId}/artifacts/${artifactPath}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual VNF Package Artifact in octet stream format  
    Log    Trying to get a VNF Package Artifact
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ ${MANIFEST_PERMITTED_SCOPE} vnfpkgm:v2:manifest:readonly
${CONTENT_PERMITTED_SCOPE}    vnfpkgm:v2:vnf_package_content 
${CONTENT_NOT_PERMITTED_SCOPE}    vnfpkgm:v2:vnf_package_content:readonly
${BULK_PERMITTED_SCOPE}    vnfpkgm:v2:bulk_artifacts:readonly
${ARTIFACT_PERMITTED_SCOPE}    vnfpkgm:v2:artifact:readonly

${NOT_PERMITTED_SCOPE}    vnfpkgm:v2:invalid