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

added oauth scope tests for individual change state op occ state task

parent 620891e2
Loading
Loading
Loading
Loading
+27 −1
Original line number Diff line number Diff line
@@ -80,3 +80,29 @@ DELETE Individual Change State Operation Occurrence - Method not implemented
    ...    Post-Conditions: none
    Send Delete request for Individual Change State Operation Occurrence
    Check HTTP Response Status Code Is    405

GET Individual Change State Operation Occurrence with permitted authorization scope
    [Documentation]    Test ID: 8.3.1.4.7
    ...    Test title: GET Individual Change State Operation Occurrence with permitted authorization scope
    ...    Test objective: The objective is to query status information about Individual change state operation occurrence with permitted authorization scope.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.9.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions:  none
    Get Individual Change State Operation Occurrence with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ChangeStateOpOcc

GET Individual Change State Operation Occurrence with not permitted authorization scope
    [Documentation]    Test ID: 8.3.1.4.8
    ...    Test title: GET Individual Change State Operation Occurrence with not permitted authorization scope
    ...    Test objective: The objective is test that the query status information about Individual change state operation occurrence fails with not permitted authorization scope.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.9.3.2 - ETSI GS NFV-SOL 009 [7] v4.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions:  none
    Get Individual Change State Operation Occurrence with not permitted authorization scope
    Check HTTP Response Status Code Is    401
+25 −2
Original line number Diff line number Diff line
@@ -333,10 +333,33 @@ Get Individual Change State Operation Occurrence
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}


Get Individual Change State Operation Occurrence with permitted authorization scope
    Log    Query to GET information about individual change state operation occurrences.
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    ${scopeValue}=    Create Dictionary    scope=${CHANGE_STATE_OPS_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/change_state_ops/${changeStateOpOccId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}

Get Individual Change State Operation Occurrence with not permitted authorization scope
    Log    Query to GET information about individual change state operation occurrences.
    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    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/change_state_ops/${changeStateOpOccId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}

Send Put request for Individual Change State Operation Occurrence
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}

    Put    ${apiRoot}/${apiName}/${apiMajorVersion}/change_state_ops/${changeStateOpOccId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}