Commit 258b2ec6 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for LogM individual jobs

parent c21ee376
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -90,3 +90,28 @@ DELETE Individual Logging Job with invalid resource identifier
    Send Delete request for individual Logging Job with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails

DELETE Individual Logging Job with permitted authorization scope
    [Documentation]    Test ID: 8.3.4.2.8
    ...    Test title: DELETE Individual Logging Job with permitted authorization scope
    ...    Test objective: The objective is to test the deletion of an individual logging job with permitted authorization scope
    ...    Pre-conditions: Logging Job is already created.
    ...    Reference: clause 8.5.4.3.5 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Logging Job is no more available.   
    Send Delete request for individual Logging Job with permitted authorization scope
    Check HTTP Response Status Code Is    204
    Check Postcondition Logging Job is Deleted

DELETE Individual Logging Job with not permitted authorization scope
    [Documentation]    Test ID: 8.3.4.2.9
    ...    Test title: DELETE Individual Logging Job with not permitted authorization scope
    ...    Test objective: The objective is to test that the deletion of an individual logging job fails when using a not permitted authorization scope
    ...    Pre-conditions: Logging Job is already created.
    ...    Reference: clause 8.5.4.3.5 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Logging Job is no more available.   
    Send Delete request for individual Logging 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
@@ -260,6 +260,28 @@ Send Delete request for individual Logging Job
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Delete request for individual Logging Job with permitted authorization scope
    Log    Trying to delete an existing logging Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${JOB_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}
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/log_jobs/${logJobId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Delete request for individual Logging Job with not permitted authorization scope
    Log    Trying to delete an existing logging Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${JOB_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}
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/log_jobs/${logJobId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Check Postcondition Logging Job is Deleted
    Log    Check Postcondition
    GET individual Logging Job