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

added oauth scope tests for NS LCM individual Coordinations

parent 21db903f
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -111,3 +111,29 @@ DELETE an individual coordination action of an LCM operation occurrence - method
    ...    Post-Conditions: none
    DELETE an individual coordination action of an LCM operation occurrence
    Check HTTP Response Status Code Is    405

Get information about a finished coordination task with permitted authorization scope
    [Documentation]    Test ID: 5.3.8.3.9
    ...    Test title:  Get information about a finished coordination task with permitted authorization scope
    ...    Test objective: The objective is to retrieve information about an individual coordination task with permitted authorization scope
    ...    Pre-conditions: Individual coordination task is terminated
    ...    Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_OSS/BSS
    ...    Applicability: none
    ...    Post-Conditions: none
    Retrieve information about a finished coordination task with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   LcmCoord


Get information about a finished coordination task with not permitted authorization scope
    [Documentation]    Test ID: 5.3.8.3.9
    ...    Test title:  Get information about a finished coordination task with not permitted authorization scope
    ...    Test objective: The objective is to test that retrieve information about an individual coordination task fails when using not permitted authorization scope
    ...    Pre-conditions: Individual coordination task is terminated
    ...    Reference: Clause 12.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_OSS/BSS
    ...    Applicability: none
    ...    Post-Conditions: none
    Retrieve information about a finished coordination task with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+25 −0
Original line number Diff line number Diff line
@@ -179,6 +179,31 @@ Retrieve information about a finished coordination task
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Retrieve information about a finished coordination task with permitted authorization scope  
    Log    Requesting the retrieve of a finished 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.GET    ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${coordinationId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


Retrieve information about a finished coordination task with not permitted authorization scope  
    Log    Requesting the retrieve of a finished 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.GET    ${apiRoot}/${apiName}/${apiMajorVersion}/coordinations/${coordinationId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
 
 
Retrieve information about an ongoing coordination task   
    Log    Requesting the retrieve of an ongoing coordination task