Commit 0cfd34da authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added oauth scope tests for NSLCM continue task

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

POST Continue operation task with permitted authorization scope
     [Documentation]    Test ID: 5.3.2.12.8
    ...    Test title: POST Continue operation task with permitted authorization scope
    ...    Test objective: The objective is to test that POST method trigger a continue on the LCM operation with permitted authorization scope
    ...    Pre-conditions: NS instance status equal to FAILED_TEMP
    ...    Reference: Clause 6.4.13.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 Continue operation task with permitted authorization scope
	Check HTTP Response Status Code Is    202
	Check operation resource state is not FAILED_TEMP

POST Continue operation task with not permitted authorization scope
     [Documentation]    Test ID: 5.3.2.12.9
    ...    Test title: POST Continue operation task with not permitted authorization scope
    ...    Test objective: The objective is to test that POST method trigger a continue on the LCM operation fails when using not permitted authorization scope
    ...    Pre-conditions: NS instance status equal to FAILED_TEMP
    ...    Reference: Clause 6.4.13.3.1 - ETSI GS NFV-SOL 005 [3] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
	POST Continue 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
@@ -1375,6 +1375,28 @@ POST Continue operation task
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST Continue operation task with permitted authorization scope
    Log    Continue 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}/continue
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

POST Continue operation task with not permitted authorization scope
    Log    Continue 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}/continue
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

GET Fail 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}"}