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

added oauth scope tests for PNFD archive manifest

parent eb048b8d
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -1516,6 +1516,27 @@ Get PNFD Archive Manifest
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get PNFD Archive Manifest with permitted authorization scope
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    ${scopeValue}=    Create Dictionary    scope=${PNFD_MANIFEST_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/${pnfdInfoId}/manifest
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


Get PNFD Archive Manifest with not permitted authorization scope
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    ${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/${pnfdInfoId}/manifest
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get PNFD Archive Manifest with security information
    Log    Trying to get a PNFD present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
+26 −1
Original line number Diff line number Diff line
@@ -93,3 +93,28 @@ DELETE PNFD Archive Manifest - Method not implemented
    ...    Post-Conditions: none
    Send DELETE Request for PNFD Archive Manifest
    Check HTTP Response Status Code Is    405

Get PNFD Archive Manifest with permitted authorization scope
    [Documentation]    Test ID: 5.3.1.14.8
    ...    Test title: Get PNFD Archive Manifest with permitted authorization scope
    ...    Test objective: The objective is to test that GET method reads the content of the manifest file within an PNFD archive with permitted authorization scope
    ...    Pre-conditions: One or more PNFDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.7b.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get PNFD Archive Manifest with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    text/plain

Get PNFD Archive Manifest with not permitted authorization scope
    [Documentation]    Test ID: 5.3.1.14.9
    ...    Test title: Get PNFD Archive Manifest with not permitted authorization scope
    ...    Test objective: The objective is to test that GET method to read the content of the manifest file within an PNFD archive fails when a not permitted authorization scope
    ...    Pre-conditions: One or more PNFDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.7b.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get PNFD Archive Manifest with not permitted authorization scope
    Check HTTP Response Status Code Is    401
+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
${PNFF_MANIFEST_PERMITTED_SCOPE}    nsd:v2:pnfd:readonly
${PNF_MANIFEST_PERMITTED_SCOPE}    nsd:v2:pnfd:readonly
${PNFD_ARTIFACTS_PERMITTED_SCOPE}    nsd:<vn>:pnfd_artifacts:readonly 
${NOT_PERMITTED_SCOPE}    nfvmanologm:v2:nvalid