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

added oauth scope tests for NSLCM Retry task

parent c447c675
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -1259,6 +1259,28 @@ POST Retry operation task
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST Retry operation task with permitted authorization scope
    Log    Retry a NS lifecycle operation if that operation has experienced a temporary failure
    ${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}/retry
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST Retry operation task with not permitted authorization scope
    Log    Retry a NS lifecycle operation if that operation has experienced a temporary failure
    ${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}/retry
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
GET Rollback operation task
    log    Trying to perform a GET. This method should not be implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
+26 −0
Original line number Diff line number Diff line
@@ -96,6 +96,32 @@ DELETE Retry operation task - Method not implemented
    DELETE Retry operation task
    Check HTTP Response Status Code Is    405

Post Retry operation task with permitted authorization scope
     [Documentation]    Test ID: 5.3.2.10.8
    ...    Test title: Post Retry operation task with permitted authorization scope
    ...    Test objective: The objective is to test that POST method trigger a retry of NS lifecycle operation in case of temporary failure with permitted authorization scope
    ...    Pre-conditions: NS instance status equal to FAILED_TEMP
    ...    Reference: Clause 6.4.11.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: NS instance status not equal to FAILED_TEMP
	POST Retry operation task with permitted authorization scope
	Check HTTP Response Status Code Is    202
	Check HTTP Response Header Contains    Location
	Check operation resource state is not FAILED_TEMP

Post Retry operation task with not permitted authorization scope
     [Documentation]    Test ID: 5.3.2.10.8
    ...    Test title: Post Retry operation task with not permitted authorization scope
    ...    Test objective: The objective is to test that POST method trigger a retry of NS lifecycle operation in case of temporary failure fails when using not permitted authorization scope
    ...    Pre-conditions: NS instance status equal to FAILED_TEMP
    ...    Reference: Clause 6.4.11.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
	POST Retry operation task with not permitted authorization scope
	Check HTTP Response Status Code Is    401