Commit 480ead27 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for LogM subscriptions

parent 6e009b9e
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -505,6 +505,30 @@ Get all Subscriptions
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get all Subscriptions with permitted authorization scope
    [Documentation]    The api consumer can use this method to query the list of active subscriptions to log management notifications
    Set headers    {"Accept": "application/json"}
    Set headers    {"Content-Type": "application/json"}
    ${scopeValue}=    Create Dictionary    scope=${SUBSCRIPTIONS_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}/subscriptions
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get all Subscriptions with not permitted authorization scope
    [Documentation]    The api consumer can use this method to query the list of active subscriptions to log management notifications
    Set headers    {"Accept": "application/json"}
    Set headers    {"Content-Type": "application/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}/subscriptions
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
 Get Subscriptions with attribute-based filters
    [Documentation]    The api consumer can use this method to query the list of active subscriptions to log management notifications
    Set headers    {"Accept": "${ACCEPT_JSON}"}
+25 −0
Original line number Diff line number Diff line
@@ -205,3 +205,28 @@ POST Create new Subscription - Unprocessable content
    Send Post Request for Subscription with unreachable callbackUri
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails

GET all Subscriptions with permitted authorization scope
    [Documentation]    Test ID: 8.3.4.5.16
    ...    Test title: GET all Subscriptions with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval list of active subscriptions list to log management notifications with permitted authorization scope
    ...    Pre-conditions:  At least one subscription is available in the NFV-MANO.
    ...    Reference: clause 8.5.7.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none    
    Get all Subscriptions with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    LogmSubscriptions

GET all Subscriptions with not permitted authorization scope
    [Documentation]    Test ID: 8.3.4.5.17
    ...    Test title: GET all Subscriptions with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval list of active subscriptions list to log management notifications fails when using not permitted authorization scope
    ...    Pre-conditions:  At least one subscription is available in the NFV-MANO.
    ...    Reference: clause 8.5.7.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none    
    Get all Subscriptions with not permitted authorization scope
    Check HTTP Response Status Code Is    401