Commit 29e3b538 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NSLCM cancel task

parent f2fcf298
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -94,3 +94,28 @@ DELETE Cancel operation task - Method not implemented
    ...    Post-Conditions: none
    DELETE Cancel operation task
    Check HTTP Response Status Code Is    405

POST Cancel operation task with permitted authorization scope
    [Documentation]    Test ID: 5.3.2.14.8
    ...    Test title: POST Cancel operation task with permitted authorization scope
    ...    Test objective: The objective is to test that POST method cancel the NS LCM operation with permitted authorization scope
    ...    Pre-conditions: NS instance status equal to STARTING, PROCESSING or ROLLING_BACK
    ...    Reference: Clause 6.4.15.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: NS instance status equal to FAILED_TEMP     
	POST Cancel operation task with permitted authorization scope
	Check HTTP Response Status Code Is    202
	Check operation resource state is FAILED_TEMP

POST Cancel operation task with not permitted authorization scope
    [Documentation]    Test ID: 5.3.2.14.9
    ...    Test title: POST Cancel operation task with not permitted authorization scope
    ...    Test objective: The objective is to test that POST method cancel the NS LCM operation fails when using not permitted authorization scope
    ...    Pre-conditions: NS instance status equal to STARTING, PROCESSING or ROLLING_BACK
    ...    Reference: Clause 6.4.15.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none   
	POST Cancel operation task with not permitted authorization scope
	Check HTTP Response Status Code Is    401
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
@@ -1491,6 +1491,28 @@ POST Cancel operation task
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST Cancel operation task with permitted authorization scope
    Log    Cancel a NS lifecycle operation task
    ${scopeValue}=    Create Dictionary    scope=${OPOCCS_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}
    Log    Execute Query and validate response
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/cancel
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST Cancel operation task with not permitted authorization scope
    Log    Cancel a NS lifecycle operation task
    ${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}
    Log    Execute Query and validate response
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_lcm_op_occs/${nsLcmOpOccId}/cancel
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
PUT subscriptions
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}