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

added oauth scope tests for NSPM thresholds

parent 8b1c9431
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -476,6 +476,29 @@ GET all Performance Thresholds
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET all Performance Thresholds with permitted authorization scope
    Log    Trying to get all thresholds 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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

 
GET all Performance Thresholds with not permitted authorization scope
    Log    Trying to get all thresholds 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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}   

GET Performance Thresholds with attribute-based filter
    Log    Trying to get thresholds present in the NFVO with filter
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
+25 −0
Original line number Diff line number Diff line
@@ -156,3 +156,28 @@ POST new Performance Threshold - Unprocessable Content
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails

GET All Performance Thresholds with permitted authorization scope
    [Documentation]    Test ID: 5.3.4.4.12
    ...    Test title: GET All Performance Thresholds with permitted authorization scope
    ...    Test objective: The objective is to test the retrieval of all the available NS performance thresholds 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.5.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET all Performance Thresholds with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   Thresholds

GET All Performance Thresholds with not permitted authorization scope
    [Documentation]    Test ID: 5.3.4.4.13
    ...    Test title: GET All Performance Thresholds with not permitted authorization scope
    ...    Test objective: The objective is to test that the retrieval of all the available NS performance thresholds 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.5.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET all Performance Thresholds with not permitted authorization scope
    Check HTTP Response Status Code Is    401