Commit 063cbdf8 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for LogM individual reports

parent 258b2ec6
Loading
Loading
Loading
Loading
+27 −1
Original line number Diff line number Diff line
@@ -87,3 +87,29 @@ DELETE Individual Log Report - Method not implemented
    ...    Post-Conditions: none
    Send Delete request for Individual Log Report
    Check HTTP Response Status Code Is    405

Get Individual Log Report with permitted authorization scope
    [Documentation]    Test ID: 8.3.4.3.8
    ...    Test title: Get Individual Log Report with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual log report with permitted authorization scope
    ...    Pre-conditions: One or more log reports are set.
    ...    Reference: clause 8.5.5.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Log Report with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   LogReport

Get Individual Log Report with not permitted authorization scope
    [Documentation]    Test ID: 8.3.4.3.9
    ...    Test title: Get Individual Log Report with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval of an individual log report fails when using not permitted authorization scope
    ...    Pre-conditions: One or more log reports are set.
    ...    Reference: clause 8.5.5.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Log Report with not permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   LogReport
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
@@ -310,6 +310,28 @@ Get Individual Log Report
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual Log Report with permitted authorization scope
    Log    Trying to get log report
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${REPORT_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}/log_jobs/${logJobId}/log_reports/${reportId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual Log Report with not permitted authorization scope
    Log    Trying to get log report
    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}/log_jobs/${logJobId}/log_reports/${reportId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual Log Report with invalid resource endpoint
    Log    Trying to get a log report with invalid resource endpoint
    Set Headers    {"Accept": "${ACCEPT_JSON}"}