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

added oauth scope tests for NSLCM fail task

parent 0cfd34da
Loading
Loading
Loading
Loading
+24
Changes for SOL005/NSLifecycleManagement-API/FailOperationTask.robot: 24 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
@@ -95,4 +95,28 @@ DELETE Fail operation task - Method not implemented
    DELETE Fail operation task
    DELETE Fail operation task
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405


POST Fail operation task with permitted authorization scope
    [Documentation]    Test ID: 5.3.2.13.8
    ...    Test title: POST Fail operation task with permitted authorization scope
    ...    Test objective: The objective is to test that POST method trigger a state change to "finally failed" on the NS LCM operation with permitted authorization scope
    ...    Pre-conditions: NS instance status equal to FAILED_TEMP
    ...    Reference: Clause 6.4.14.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
	POST Fail operation task with permitted authorization scope
	Check HTTP Response Status Code Is    202
	Check resource is finally failed
    
POST Fail operation task with not ermitted authorization scope
    [Documentation]    Test ID: 5.3.2.13.9
    ...    Test title: POST Fail operation task with not ermitted authorization scope
    ...    Test objective: The objective is to test that POST method trigger a state change to "finally failed" on the NS LCM operation fails when using not permitted authorization scope
    ...    Pre-conditions: NS instance status equal to FAILED_TEMP
    ...    Reference: Clause 6.4.14.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
	POST Fail operation task with not permitted authorization scope
	Check HTTP Response Status Code Is    401
    
    
 No newline at end of file
+22
Changes for SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot: 22 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
@@ -1426,6 +1426,28 @@ DELETE Fail operation task
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
	
	
POST Fail operation task
POST Fail operation task
    Log    Fail 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}/fail
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST Fail operation task with permitted authorization scope
    Log    Fail 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}/fail
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
POST Fail operation task with not permitted authorization scope
    Log    Fail a NS lifecycle operation task
    Log    Fail a NS lifecycle operation task
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Log    Execute Query and validate response
    Log    Execute Query and validate response