Commit 66acd886 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NSD archive manifest

parent 953a74db
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -93,3 +93,28 @@ DELETE NSD Archive Manifest - Method not implemented
    ...    Post-Conditions: none
    Send DELETE Request for NSD Archive Manifest
    Check HTTP Response Status Code Is    405

Get NSD Archive Manifest with permitted authorization scope
    [Documentation]    Test ID: 5.3.1.12.8
    ...    Test title: Get NSD 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 NSD archive with permitted authorization scope
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.4b.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get NSD Archive Manifest with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    text/plain

Get NSD Archive Manifest with not permitted authorization scope
    [Documentation]    Test ID: 5.3.1.12.9
    ...    Test title: Get NSD Archive Manifest with not permitted authorization scope
    ...    Test objective: The objective is to test that GET method reads the content of the manifest file within an NSD archive fails when using not permitted authorization scope
    ...    Pre-conditions: One or more NSDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.4b.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get NSD Archive Manifest 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
@@ -1237,6 +1237,26 @@ Get NSD Archive Manifest
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

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

Get NSD 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/${nsdInfoIdPlain}/manifest
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get NSD Archive Manifest with security information
    Log    Trying to get a NSD present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ ${NSD_NOT_PERMITTED_SCOPE} nsd:v2:ns_descriptors:readonly
${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


${NOT_PERMITTED_SCOPE}    nfvmanologm:v2:nvalid