Commit 50ae7409 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NS LCM cancel coordination task

parent c42a6b0c
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -98,3 +98,27 @@ DELETE information about a cancellation of an ongoing coordination action - meth
    ...    Post-Conditions: none
    DELETE information about a cancellation of an ongoing coordination action
    Check HTTP Response Status Code Is    405

Request a cancellation of an ongoing coordination action with permitted authorization scope
    [Documentation]    Test ID: 5.3.8.4.8
    ...    Test title:  Request a cancellation of an ongoing coordination action with permitted authorization scope
    ...    Test objective: The objective is to test the request for the cancellation of an ongoing coordination task with permitted authorization scope
    ...    Pre-conditions: An ongoing coordination action is available
    ...    Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_OSS/BSS
    ...    Applicability: none
    ...    Post-Conditions: none 
    Send Post Request for cancellation of an ongoing coordination action with permitted authorization scope
    Check HTTP Response Status Code Is    202

Request a cancellation of an ongoing coordination action with not permitted authorization scope
    [Documentation]    Test ID: 5.3.8.4.9
    ...    Test title:  Request a cancellation of an ongoing coordination action with not permitted authorization scope
    ...    Test objective: The objective is to test that the request for the cancellation of an ongoing coordination task fails when using not permitted authorization scope
    ...    Pre-conditions: An ongoing coordination action is available
    ...    Reference: Clause 12.4.4.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_OSS/BSS
    ...    Applicability: none
    ...    Post-Conditions: none 
    Send Post Request for cancellation of an ongoing coordination action with not permitted authorization scope
    Check HTTP Response Status Code Is    202
 No newline at end of file
+25 −0
Original line number Diff line number Diff line
@@ -272,6 +272,31 @@ Send Post Request for cancellation of an ongoing coordination action
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request for cancellation of an ongoing coordination action with permitted authorization scope
    Log    Requesting the cancellation of an ongoing coordination task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${ALL_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Run Keyword If    ${NFVO_AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    REST.POST    ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${ongoingCoordinationId}/cancel
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


Send Post Request for cancellation of an ongoing coordination action with not permitted authorization scope
    Log    Requesting the cancellation of an ongoing coordination task
    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    ${NFVO_AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    Log    Authorization Token: ${authorizationToken}
    REST.POST    ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${ongoingCoordinationId}/cancel
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post Request for cancellation of a finished coordination action
    Log    Requesting the cancellation of a finished coordination task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}