From 76b85a6fee0461eb205f6ebddc707a8338bb5d37 Mon Sep 17 00:00:00 2001 From: zhaome Date: Tue, 29 Jan 2019 16:15:25 +0100 Subject: [PATCH] SOL 003 LCM workflow completed --- .../CancelOperationTask.robot | 30 ++----- .../CancelOperationWorkflow.robot | 80 +++++++++++++++++++ .../FailOperationTask.robot | 4 +- .../FailOperationWorkflow.robot | 52 ++++++++++++ .../RetryOperationWorkflow.robot | 2 +- .../RollBackOperationWorkflow.robot | 76 ++++++++++++++++++ .../VnfLcmMntOperationKeywords.robot | 15 ++++ 7 files changed, 230 insertions(+), 29 deletions(-) create mode 100644 SOL003/VNFLifecycleManagement-API/CancelOperationWorkflow.robot create mode 100644 SOL003/VNFLifecycleManagement-API/FailOperationWorkflow.robot create mode 100644 SOL003/VNFLifecycleManagement-API/RollBackOperationWorkflow.robot diff --git a/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot b/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot index 59e6b913..6b189749 100644 --- a/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot @@ -13,7 +13,7 @@ Suite Setup Check resource existance Post Cancel operation task [Documentation] The POST method initiates cancelling an ongoing VNF lifecycle operation while it is being executed or rolled back, i.e. ... the related "VNF LCM operation occurrence" is either in "PROCESSING" or "ROLLING_BACK" state. - Log Cancel a VNF lifecycle operation if that operation has experienced a temporary failure + Log Cancel an ongoing VNF lifecycle operation Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Log Cancel a VNF lifecycle operation Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel ${CancelMode} @@ -23,15 +23,14 @@ Post Cancel operation task Should Contain ${headers} Location Log Validation OK -Post Cancel operation task Conflict (Not-FAILED_TEMP) - # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state +Post Cancel operation task Conflict [Documentation] Conflict. ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, + ... Typically, this is due to the fact that the VNF instance resource is not in STARTING, PROCESSING or ROLLING_BACK state, ... or another error handling action is starting, such as retry or rollback. ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - Depends on test failure Check resource FAILED_TEMP - Log Final Fail an operation + Depends on test Check resource FAILED_TEMP + Log Cancel an operation Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail Integer response status 409 @@ -41,25 +40,6 @@ Post Cancel operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${json} Log Validation OK -Post Cancel operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - [Documentation] Conflict - ... The operation cannot be executed currently, due to a conflict with the state of the VNF instance resource. - ... Typically, this is due to the fact that the VNF instance resource is not in FAILED_TEMP state, - ... or another error handling action is starting, such as retry or rollback. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another error handling action - log Final Fail an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - ${json}= evaluate json.loads('''${problemDetails}''') json - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - [Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished - Post Cancel operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent [Documentation] Not Found diff --git a/SOL003/VNFLifecycleManagement-API/CancelOperationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/CancelOperationWorkflow.robot new file mode 100644 index 00000000..f7347a33 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/CancelOperationWorkflow.robot @@ -0,0 +1,80 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Cancel a VNF LCM Operation - STARTING + [Documentation] Test ID: 5.x.x.x + ... Test title: Cancel a VNF LCM Operation + ... Test objective: The objective is to test the workflow for Cancelling a VNF LCM Operation + ... Pre-conditions: The VNF lifecycle management operation occurrence is in STARTING state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in ROLLED_BACK state + Send Cancel Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Cancel ROLLED_BACK + Check Postcondition VNF Cancel - STARTING + +Cancel a VNF LCM Operation - PROCESSING - ROLLING_BACK + [Documentation] Test ID: 5.x.x.x + ... Test title: Cancel a VNF LCM Operation + ... Test objective: The objective is to test the workflow for Cancelling a VNF LCM Operation + ... Pre-conditions: The VNF lifecycle management operation occurrence is in PROCESSING or ROLLING_BACK state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state + Send Cancel Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Cancel FAILED_TEMP + Check Postcondition VNF Cancel - PROCESSING - ROLLING_BACK + + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks - STARTING + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState STARTING + +Precondition Checks - PROCESSING - ROLLING_BACK + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState PROCESSING + +Check Postcondition VNF Cancel - STARTING + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState ROLLED_BACK + +Check Postcondition VNF Cancel - PROCESSING - ROLLING_BACK + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Operation Notification For Cancel + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot index ca71d402..2091e372 100644 --- a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot @@ -21,9 +21,7 @@ Post Fail operation task Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail Output response Log Validate Status code - Integer response status 202 - ${headers}= Output response headers - Should Contain ${headers} Location + Integer response status 200 Log Validation OK Post Fail operation task Conflict (Not-FAILED_TEMP) diff --git a/SOL003/VNFLifecycleManagement-API/FailOperationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/FailOperationWorkflow.robot new file mode 100644 index 00000000..d0fc1c2c --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/FailOperationWorkflow.robot @@ -0,0 +1,52 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Fail VNF LCM Operation + [Documentation] Test ID: 5.x.x.x + ... Test title: Fail a VNF LCM Operation + ... Test objective: The objective is to test the workflow for a Fail VNF LCM Operation + ... Pre-conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in FAILED state + Send Fail Operation Request + Check Operation Notification For Fail FAILED + Check HTTP Response Status Code Is 200 #the order of notification and the response code is not defined. How to implement this? + Check Postcondition VNF Fail + + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Postcondition VNF Fail + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED + +Check Operation Notification For Fail + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.robot index 6a6e61d6..d2a68de9 100644 --- a/SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.robot +++ b/SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.robot @@ -47,7 +47,7 @@ Retry VNF LCM Operation - Unsuccessful Check HTTP Response Header Contains Location Check Operation Occurrence Id Check Operation Notification For Retry PROCESSING - Check Operation Notification For Retry COMPLETED + Check Operation Notification For Retry FAILED_TEMP Check Postcondition VNF Retry Unsuccessful *** Keywords *** diff --git a/SOL003/VNFLifecycleManagement-API/RollBackOperationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/RollBackOperationWorkflow.robot new file mode 100644 index 00000000..12724068 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/RollBackOperationWorkflow.robot @@ -0,0 +1,76 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Resource environment/scaleVariables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml +Library OperatingSystem +Library BuiltIn +Library Collections +Library JSONLibrary +Library Process +Suite Setup Initialize System +Suite Teardown Terminate All Processes kill=true + + +*** Test Cases *** +Roll back a VNF LCM Operation - Successful + [Documentation] Test ID: 5.x.x.x + ... Test title: Roll back VNF LCM Operation - Successful + ... Test objective: The objective is to test the workflow for a Rolling Back a VNF LCM Operation and the operation is successful + ... Pre-conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.11 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in ROLLED_BACK state + Send Roll back Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Roll Back ROLLING_BACK + Check Operation Notification For Roll Back ROLLED_BACK + Check Postcondition VNF Roll Back Successful + +Retry VNF LCM Operation - Unsuccessful + [Documentation] Test ID: 5.x.x.x + ... Test title: Retry VNF LCM Operation - Unsuccessful + ... Test objective: The objective is to test the workflow for a Retry VNF LCM Operation and the operation is not successful + ... Pre-conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state. NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) + ... Reference: section 5.3.10 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM + ... Post-Conditions: The VNF lifecycle management operation occurrence is in FAILED_TEMP state + Send Roll back Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Roll Back ROLLING_BACK + Check Operation Notification For Roll Back FAILED_TEMP + Check Postcondition VNF Roll Back UnSuccessful + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Postcondition VNF Roll Back Successful + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState ROLLED_BACK + +Check Postcondition VNF Roll Back Unsuccessful + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState FAILED_TEMP + +Check Operation Notification For Roll Back + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index 7cb66db3..ab10db01 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -174,6 +174,21 @@ Send Retry Operation Request Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry +Send Roll back Operation Request + Log Rollback a VNF lifecycle operation if that operation has experienced a temporary failure + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback + +Send Fail Operation Request + Log Fail a VNF lifecycle operation if that operation has experienced a temporary failure + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail + +Send Cancel Operation Request + Log Cancel an ongoing VNF lifecycle operation + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel ${CancelMode} + Create a new Grant - Synchronous mode [Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation} Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants -- GitLab