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

added oauth scope tests for NSFM individual subscriptions

parent be984b3a
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -66,3 +66,26 @@ DELETE an individual subscription
    ...    Post-Conditions: subscription is not deleted
    DELETE Individual Subscription
    Check HTTP Response Status Code Is    204

Get Information about an individual subscription with permitted authorization scope
    [Documentation]    Test ID: 5.3.3.4.6
    ...    Test title: Get Information about an individual subscription with permitted authorization scope
    ...    Test objective: The objective is to read an individual subscription for NFVO alarms subscribed by the client with permitted authorization scope
    ...    Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    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    FmSubscription

Get Information about an individual subscription with not permitted authorization scope
    [Documentation]    Test ID: 5.3.3.4.7
    ...    Test title: Get Information about an individual subscription with not permitted authorization scope
    ...    Test objective: The objective is to test that read an individual subscription for NFVO alarms subscribed by the client fails when using a not permitted authorization scope
    ...    Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability:  none
    ...    Post-Conditions: none
    GET Individual Subscription 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
@@ -421,6 +421,28 @@ POST Individual Subscription
    Set Global Variable    ${response}    ${outputResponse}
    
GET Individual Subscription
    log    Trying to get information about an individual subscription
    Set Headers    {"Accept":"${ACCEPT}"}  
    ${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}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}   

GET Individual Subscription with permitted authorization scope
    log    Trying to get information about an individual subscription
    Set Headers    {"Accept":"${ACCEPT}"}  
    ${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}
    ${outputResponse}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}   

GET Individual Subscription with not permitted authorization scope
    log    Trying to get information about an individual subscription
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}