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

added oauth scope tests for PNFD

parent 5519be64
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -1395,6 +1395,28 @@ Get single file PNFD in Plain Format
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get single file PNFD in Plain Format with permitted authorization scope
    Log    Trying to get a PNFD present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    ${scopeValue}=    Create Dictionary    scope=${PNFDF_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}/pnfd
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get single file PNFD in Plain Format with not permitted authorization scope
    Log    Trying to get a PNFD present in the NFVO Catalogue
    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}/pnfd
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get PNFD in Zip Format
    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
@@ -159,3 +159,28 @@ DELETE PNFD - Method not implemented
    ...    Post-Conditions: none
    Send DELETE Request for PNFD
    Check HTTP Response Status Code Is    405

Get single file PNFD in Plain Format with permitted authorization scope
    [Documentation]    Test ID: 5.3.1.13.13
    ...    Test title: Get single file PNFD in Plain Format with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of the PNFD in plain format within a PNFD archive with permitted authorization scope
    ...    Pre-conditions: One or more PNFDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.7a.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The PNFD is implemented as a single file
    ...    Post-Conditions: none
    Get single file PNFD in Plain Format with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Content-Type Is    text/plain

Get single file PNFD in Plain Format with not permitted authorization scope
    [Documentation]    Test ID: 5.3.1.13.14
    ...    Test title: Get single file PNFD in Plain Format with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval of the PNFD in plain format within a PNFD archive fails when using a not permitted authorization scope
    ...    Pre-conditions: One or more PNFDs are onboarded in the NFVO.
    ...    Reference: Clause 5.4.7a.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The PNFD is implemented as a single file
    ...    Post-Conditions: none
    Get single file PNFD in Plain Format with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file