From 73eaffb535fee9c346f78a0382d7a8a20080182d Mon Sep 17 00:00:00 2001 From: zhaome Date: Mon, 28 Jan 2019 22:18:07 +0100 Subject: [PATCH] ModifyVNFInformationWorkflow and RetryOperationWorkflow --- .../ModifyVNFInformationWorkflow.robot | 58 ++++++++++++++ .../RetryOperationWorkflow.robot | 76 +++++++++++++++++++ .../VnfLcmMntOperationKeywords.robot | 15 +++- .../environment/variables.txt | 3 +- 4 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 SOL003/VNFLifecycleManagement-API/ModifyVNFInformationWorkflow.robot create mode 100644 SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.robot diff --git a/SOL003/VNFLifecycleManagement-API/ModifyVNFInformationWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ModifyVNFInformationWorkflow.robot new file mode 100644 index 00000000..5b22d8b3 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/ModifyVNFInformationWorkflow.robot @@ -0,0 +1,58 @@ +*** 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 *** +Modify info of a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Update information about a VNF instance + ... Test objective: The objective is to update information about a VNF instance. + ... Pre-conditions: VNF instance is created (Test ID: 5.a.b.c) + ... Reference: section 5.3.6 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. Update information of a VNF instance is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance info is updated + Send Info Modification Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Modify Info start #need more info about the notification content + Check Operation Notification For Modify Info result #need more info about the notification content, how the result is presented + Check Postcondition VNF Modify Info + +*** Keywords *** + +Initialize System + Create Sessions + ${body}= Get File json/patchBodyRequest.json + ${patchBodyRequest}= evaluate json.loads('''${body}''') json + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + +Check Postcondition VNF Modify Info + Check VNF Instance ${vnfInstanceId} + Check HTTP Response Status Code Is 200 + #do we need to compare the modified info in the updated VNF instance with the values in the request? + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Modify Info + [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 new file mode 100644 index 00000000..6a6e61d6 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/RetryOperationWorkflow.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 *** +Retry VNF LCM Operation - Successful + [Documentation] Test ID: 5.x.x.x + ... Test title: Retry VNF LCM Operation - Successful + ... Test objective: The objective is to test the workflow for a Retry 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.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 COMPLETED state + Send Retry Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Retry PROCESSING + Check Operation Notification For Retry COMPLETED + Check Postcondition VNF Retry 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 Retry Operation Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Retry PROCESSING + Check Operation Notification For Retry COMPLETED + Check Postcondition VNF Retry 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 Retry Successful + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} + String response body operationState COMPLETED + +Check Postcondition VNF Retry 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 Retry + [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 735b2435..7cb66db3 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -160,7 +160,20 @@ Send Terminate VNF Request Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File json/terminateVnFRequest.json ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} - + +Send Info Modification Request + Log Trying to update information of a VNF instance. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${body}= Get File json/patchBodyRequest.json + ${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} + +Send Retry Operation Request + Log Retry 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}/retry + 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 diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index a99965c4..f6f32af2 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -22,4 +22,5 @@ ${changeVnfFlavourRequest} {} ${requestedFlavour} test ${changeVnfOperateRequest} {} ${requestedState} test -${changeVnfExtConnectivityRequest} {} \ No newline at end of file +${changeVnfExtConnectivityRequest} {} +${patchBodyRequest} {} \ No newline at end of file -- GitLab