Commit 1fdd3f82 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for individual NSD artifact

parent 66acd886
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -170,3 +170,27 @@ DELETE Individual NSD Archive Artifact - Method not implemented
    Send DELETE Request for Individual NSD Archive Artifact
    Check HTTP Response Status Code Is    405

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

GET Individual NSD Archive Artifact with not permitted authorization scope
    [Documentation]    Test ID: 5.3.1.16.14
    ...    Test title: GET Individual NSD Archive Artifact with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval of an individual NSD Archive artifact fails when using not permitted authorization scope
    ...    Pre-conditions: One or more NSD archives are on-boarded to the NFVO.
    ...    Reference: Clause 5.4.4c.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual NSD 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
@@ -1574,6 +1574,26 @@ GET Individual NSD Archive Artifact
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual NSD Archive Artifact with permitted authorization scope
    Log    Trying to get a NSD Archive Artifact
    ${scopeValue}=    Create Dictionary    scope=${NSD_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}/ns_descriptors/${nsdInfoId}/artifacts/${artifactPath}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual NSD Archive Artifact with not permitted authorization scope
    Log    Trying to get a NSD 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}/ns_descriptors/${nsdInfoId}/artifacts/${artifactPath}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
GET Individual NSD Archive Artifact with include_signatures parameter
    Log    Trying to get NSD Archive Artifact with security certificates
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ ${ARCHIVE_PERMITTED_SCOPE} nsd:v2:nsd_archive_content
${ARCHIVE_NOT_PERMITTED_SCOPE}    nsd:v2:nsd_archive_content:readonly
${NSDF_PERMITTED_SCOPE}    nsd:v2:nsd:readonly
${NSD_MANIFEST_PERMITTED_SCOPE}    nsd:v2:nsd:readonly

${NSD_ARTIFACTS_PERMITTED_SCOPE}    nsd:<vn>:nsd_artifacts:readonly 

${NOT_PERMITTED_SCOPE}    nfvmanologm:v2:nvalid