Commit 5c7f7b06 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for VNF Pkg mgmt manifest

parent 3ba0e6aa
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -105,3 +105,28 @@ DELETE Manifest in Individual VNF Package - Method not implemented
    ...    Post-Conditions: none
    Send DELETE Request for Manifest in individual VNF Package
    Check HTTP Response Status Code Is    405

Get Manifest in Individual VNF Package with permitted authorization scope
    [Documentation]    Test ID: 5.3.5.12.9
    ...    Test title: Get Manifest in Individual VNF Package with permitted authorization scope
    ...    Test objective: The objective is to test that content of manifest within a NVF Package is read successfully with permitted authorization scope.
    ...    Pre-conditions: One or more VNF packages are onboarded in the NFVO.
    ...    Reference: Clause 9.4.4b.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Manifest in Individual VNF Package in plainFormat with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    text/plain

Get Manifest in Individual VNF Package with not permitted authorization scope
    [Documentation]    Test ID: 5.3.5.12.10
    ...    Test title: Get Manifest in Individual VNF Package with not permitted authorization scope
    ...    Test objective: The objective is to test that content of manifest within a NVF Package fails when using not permitted authorization scope.
    ...    Pre-conditions: One or more VNF packages are onboarded in the NFVO.
    ...    Reference: Clause 9.4.4b.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Manifest in Individual VNF Package in plainFormat 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
@@ -1224,6 +1224,26 @@ Get Manifest in Individual VNF Package in plainFormat
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Manifest in Individual VNF Package in plainFormat with permitted authorization scope
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    ${scopeValue}=    Create Dictionary    scope=${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}/vnf_packages/${vnfPkgId}/manifest
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Manifest in Individual VNF Package in plainFormat 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}/vnf_packages/${vnfPkgId}/manifest
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get Manifest in Individual VNF Package with security information
    Log    Trying to get a manifest from a given VNF Package present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ ${INFO_PERMITTED_SCOPE} vnfpkgm:v2:vnf_package_info
${INFO_NOT_PERMITTED_SCOPE}    vnfpkgm:v2:vnf_package_info:readonly
${VNFD_PERMITTED_SCOPE}    vnfpkgm:v2:vnfd:readonly
${ACCESS_PERMITTED_SCOPE}    vnfpkgm:v2:ext_artifacts_access
${MANIFEST_PERMITTED_SCOPE}    vnfpkgm:v2:manifest:readonly

${NOT_PERMITTED_SCOPE}    vnfpkgm:v2:invalid