Commit 8d8a7493 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

updated oauth scope tests for individual subscriptions

parent bc699707
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -93,3 +93,31 @@ PATCH Individual Subscription - Method not implemented
    ...    Post-Conditions: none
    Send Patch request for individual Subscription
    Check HTTP Response Status Code Is    405

GET Individual Subscription with permitted authorization scope
    [Documentation]    Test ID: 8.3.1.11.8
    ...    Test title: GET Individual  Subscription with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of individual subscription when a permitted authorization scope is used.
    ...    Pre-conditions: At least one subscription is available in the NFV-MANO.
    ...    Reference: clause 5.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 Subscription with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   CimSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription

GET Individual Subscription with not permitted authorization scope
    [Documentation]    Test ID: 8.3.1.11.9
    ...    Test title: GET Individual  Subscription with not permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of individual subscription fails when a not permitted authorization scope is used.
    ...    Pre-conditions: At least one subscription is available in the NFV-MANO.
    ...    Reference: clause 5.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 Subscription with not permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   CimSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
@@ -810,6 +810,26 @@ Get Individual Subscription
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual Subscription with permitted authorization scope
    Set headers    {"Accept": "${ACCEPT_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/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual Subscription with not permitted authorization scope
    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}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Check HTTP Response Body Subscription Identifier matches the requested Subscription
    Log    Trying to check response ID
    Should Be Equal As Strings    ${response['body']['id']}    ${subscriptionId}