Commit 0513cfa0 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NFVICI individual thresholds

parent 761f6d9a
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -116,3 +116,28 @@ DELETE Individual Capacity Threshold
    DELETE Individual Capacity Threshold
    Check HTTP Response Status Code Is    204
    Check Postcondition resource is deleted

GET Individual Capacity Thresholds with permitted authorization scope  
    [Documentation]    Test ID: 5.3.6.4.9
    ...    Test title: GET Capacity Thresholds with permitted authorization scope  
    ...    Test objective: The objective is to test that GET method reads information about Individual Capacity Threshold with permitted authorization scope  
    ...    Pre-conditions: none
    ...    Reference: Clause 10.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 Capacity Threshold with permitted authorization scope  
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    CapacityThresholds

GET Individual Capacity Thresholds with not permitted authorization scope  
    [Documentation]    Test ID: 5.3.6.4.10
    ...    Test title: GET Capacity Thresholds with not permitted authorization scope  
    ...    Test objective: The objective is to test that GET method fails to read information about Individual Capacity Threshold when using not permitted authorization scope  
    ...    Pre-conditions: none
    ...    Reference: Clause 10.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 Capacity Threshold with not permitted authorization scope  
    Check HTTP Response Status Code Is    401
 No newline at end of file
+24 −0
Original line number Diff line number Diff line
@@ -449,6 +449,30 @@ GET Individual Capacity Threshold
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}   

GET Individual Capacity Threshold with permitted authorization scope
    log    Trying to get information about an Individual Capacity Threshold
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE_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}/capacity_thresholds/${capacityThreshold}  		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}      

GET Individual Capacity Threshold with not permitted authorization scope
    log    Trying to get information about an Individual Capacity Threshold
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE_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}/capacity_thresholds/${capacityThreshold}  		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}   
	
GET Individual Capacity Threshold - Invalid URI
    log    Trying to get information about an Individual Capacity Threshold
    Set Headers    {"Accept":"${ACCEPT_JSON}"}