Commit b9db5970 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NSD management individual subscriptions

parent 7b54c6f9
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
@@ -95,3 +95,30 @@ DELETE Individual NSD Management Subscription
    Send Delete request for individual NSD Management Subscription
    Check HTTP Response Status Code Is    204
    Check Postcondition NSD Management Subscription is Deleted

GET Individual NSD Management Subscription with permitted authorization scope
    [Documentation]    Test ID: 5.3.1.8.8
    ...    Test title: GET Individual NSD Management Subscription with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of individual NSD Management subscription with permitted authorization scope
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference: Clause 5.4.9.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual NSD Management Subscription with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   NsdmSubscription
    Check HTTP Response Body NsdmSubscription content against NS Descriptor
    Check HTTP Response Body Subscription Identifier matches the requested Subscription

GET Individual NSD Management Subscription with not permitted authorization scope
    [Documentation]    Test ID: 5.3.1.8.9
    ...    Test title: GET Individual NSD Management Subscription with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval of individual NSD Management subscription fails when not permitted authorization scope
    ...    Pre-conditions: At least one NSD Management subscription is available in the NFVO.
    ...    Reference: Clause 5.4.9.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual NSD Management Subscription with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+23 −1
Original line number Diff line number Diff line
@@ -1122,6 +1122,28 @@ Get Individual NSD Management Subscription
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual NSD Management Subscription with permitted authorization scope
    Log    Trying to get a single subscription identified by subscriptionId
    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}
    REST.GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Individual NSD Management Subscription with not permitted authorization scope
    Log    Trying to get a single subscription identified by subscriptionId
    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}
    REST.GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET individual NSD Management Subscription with invalid resource identifier
    Log    Trying to perform a request on a subscriptionID which doesn't exist
    Set Headers    {"Accept": "${ACCEPT_JSON}"}