Commit 292352fc authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NSPM individual jobs

parent cc1a2aa5
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -138,3 +138,29 @@ PATCH Individual NS Performance Job - Unprocessable Content
    Send Patch request for individual NS Performance Job with unprocessable content
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails

GET individual NS Performance Job with permitted authorization scope
    [Documentation]    Test ID: 5.3.4.2.10
    ...    Test title: Get individual NS Performance Job with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual NS Performance monitoring job with permitted authorization scope
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual NS Performance Job with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJob
    Check HTTP Response Body Pm Job Identifier matches the requested Pm Job

GET individual NS Performance Job with not permitted authorization scope
    [Documentation]    Test ID: 5.3.4.2.11
    ...    Test title: Get individual NS Performance Job with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval of an individual NS Performance monitoring job fails when using not permitted authorization scope
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual NS Performance Job with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
@@ -234,6 +234,28 @@ GET individual NS Performance Job
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET individual NS Performance Job with permitted authorization scope
    Log    Trying to get a Pm Job present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${JOBS_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}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET individual NS Performance Job with not permitted authorization scope
    Log    Trying to get a Pm Job present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${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}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET individual NS Performance Job with invalid resource identifier  
    Log    Trying to perform a negative get, using erroneous PM Job identifier
    Set Headers    {"Accept": "${ACCEPT_JSON}"}