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

added oauth scope tests for NSPM individual thresholds

parent d6302bac
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -144,3 +144,29 @@ PATCH Individual Threshold - Unprocessable Content
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check Postcondition NS performance Threshold is Unmodified (Implicit)

GET Individual Threshold with permitted authorization scope
    [Documentation]    Test ID: 5.3.4.5.10
    ...    Test title: GET Individual Threshold with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of an individual NS performance threshold with permitted authorization scope
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance thresholds are set in the NFVO.
    ...    Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual NS performance Threshold with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   Threshold
    Check HTTP Response Body Threshold Identifier matches the requested Threshold  

GET Individual Threshold with not permitted authorization scope
    [Documentation]    Test ID: 5.3.4.5.11
    ...    Test title: GET Individual Threshold with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval of an individual NS performance threshold fails when using not permitted authorization scope
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance thresholds are set in the NFVO.
    ...    Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual NS performance Threshold with not permitted authorization scope
    Check HTTP Response Status Code Is    401    
+22 −0
Original line number Diff line number Diff line
@@ -610,6 +610,28 @@ GET Individual NS performance Threshold
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual NS performance Threshold with permitted authorization scope
    Log    Trying to get a Threhsold present in the NFVO
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${THRESHOLDS_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}/thresholds/${thresholdId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Individual NS performance Threshold with not permitted authorization scope
    Log    Trying to get a Threhsold present in the NFVO
    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}/thresholds/${thresholdId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}   

GET individual NS performance Threshold with invalid resource identifier
    Log    Trying to get a Threhsold with invalid resource endpoint
    Set Headers    {"Accept": "${ACCEPT_JSON}"}