From 961a1d4d9ecf3dac80fd92cc5bfc6278e21a1377 Mon Sep 17 00:00:00 2001 From: zhaome Date: Mon, 28 Jan 2019 11:42:31 +0100 Subject: [PATCH] SOL003 task workflow completed --- .../ChangeExternalVNFConnectivityTask.robot | 2 +- ...hangeExternalVNFConnectivityWorkflow.robot | 60 +++++++++++++++++++ .../ChangeVNFFlavourWorkflow.robot | 9 --- .../HealVNFWorkflow.robot | 56 +++++++++++++++++ .../OperateVNFWorkflow.robot | 2 +- .../TerminatelVNFWorkflow.robot | 56 +++++++++++++++++ .../VnfLcmMntOperationKeywords.robot | 34 +++++++++++ 7 files changed, 208 insertions(+), 11 deletions(-) create mode 100644 SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityWorkflow.robot create mode 100644 SOL003/VNFLifecycleManagement-API/HealVNFWorkflow.robot create mode 100644 SOL003/VNFLifecycleManagement-API/TerminatelVNFWorkflow.robot diff --git a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot index 60bee901..4d7c7243 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot @@ -15,7 +15,7 @@ Change external VNF connectivity Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File json/changeExtVnfConnectivityRequest .json + ${body}= Get File json/changeExtVnfConnectivityRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} Integer response status 202 Log Status code validated diff --git a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityWorkflow.robot new file mode 100644 index 00000000..c340c5ae --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityWorkflow.robot @@ -0,0 +1,60 @@ +*** 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 *** +Operate a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Change the external connectivity of a VNF instance + ... Test objective: The objective is to change the external connectivity of a VNF instance. + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) + ... Reference: section 5.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. Change the external connectivity of a VNF instance is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance still in INSTANTIATED state and external connectivity of the VNF is changed + Send Change Ext Connectivity Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Operate STARTING + #Create a new Grant - Sync - OPERATE + Check Operation Notification For Change Flavour PROCESSING + Check Operation Notification For Change Flavour COMPLETED + Check Postcondition VNF Change Ext Connectivity + +*** Keywords *** + +Initialize System + Create Sessions + ${body}= Get File json/changeExtVnfConnectivityRequest.json + ${changeVnfExtConnectivityRequest}= 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 Change Ext Connectivity + Check resource instantiated + ${extVLId}= Get Vnf Ext Link Id ${vnfInstanceId} + Should be Equal ${changeVnfExtConnectivityRequest["extVirtualLinks"][0]["id"]} ${extVLId} + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Operate + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourWorkflow.robot index 2d74dfe5..99380901 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourWorkflow.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourWorkflow.robot @@ -16,21 +16,12 @@ Suite Teardown Terminate All Processes kill=true *** Test Cases *** -<<<<<<< .merge_file_a08480 -Change VNF Flavour Operation - [Documentation] Test ID: 5.x.y.x - ... Test title: Change VNF Flavour Operation - ... Test objective: The objective is to test a change flavour operation of an existing VNF instance - ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) - ... Reference: section 5.3.3 - SOL003 v2.4.1 -======= Change VNF Flavour [Documentation] Test ID: 5.4.7.1 ... Test title: Change VNF Flavour Workflow ... Test objective: The objective is to test the workflow for a change flavour of an existing VNF instance ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.4.4.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1) ... Reference: section 5.4.7 - SOL003 v2.4.1 ->>>>>>> .merge_file_a08764 ... Config ID: Config_prod_VNFM ... Applicability: Multiple flavours are supported for the VNF (as capability in the VNFD). NFVO is able to receive notifications from VNFM ... Post-Conditions: VNF instance still in INSTANTIATED state and the flavour is changed diff --git a/SOL003/VNFLifecycleManagement-API/HealVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/HealVNFWorkflow.robot new file mode 100644 index 00000000..2a05f4ed --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/HealVNFWorkflow.robot @@ -0,0 +1,56 @@ +*** 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 *** +Operate a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Heal a VNF Instance + ... Test objective: The objective is to heal a VNF instance. + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) + ... Reference: section 5.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. Heal a VNF instance is supported for the VNF (as capability in the VNFD) + ... Post-Conditions: VNF instance still in INSTANTIATED state + Send Heal VNF Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Operate STARTING + #Create a new Grant - Sync - OPERATE + Check Operation Notification For Change Flavour PROCESSING + Check Operation Notification For Change Flavour COMPLETED + Check Postcondition VNF Heal + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + +Check Postcondition VNF Heal + Check resource Instantiated + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Operate + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot index 8721f206..9f340e23 100644 --- a/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot +++ b/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot @@ -30,7 +30,7 @@ Operate a VNF Instance Check HTTP Response Header Contains Location Check Operation Occurrence Id Check Operation Notification For Operate STARTING - Create a new Grant - Sync - OPERATE + #Create a new Grant - Sync - OPERATE Check Operation Notification For Change Flavour PROCESSING Check Operation Notification For Change Flavour COMPLETED Check Postcondition VNF OPERATE diff --git a/SOL003/VNFLifecycleManagement-API/TerminatelVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/TerminatelVNFWorkflow.robot new file mode 100644 index 00000000..b1a07eb0 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/TerminatelVNFWorkflow.robot @@ -0,0 +1,56 @@ +*** 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 *** +Operate a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Terminate a VNF Instance + ... Test objective: The objective is to terminate a VNF instance. + ... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c) + ... Reference: section 5.3.3 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: NFVO is able to receive notifications from VNFM. + ... Post-Conditions: VNF instance in NOT_INSTANTIATED state + Send Terminate VNF Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Operate STARTING + #Create a new Grant - Sync - OPERATE + Check Operation Notification For Change Flavour PROCESSING + Check Operation Notification For Change Flavour COMPLETED + Check Postcondition VNF Terminate + +*** Keywords *** + +Initialize System + Create Sessions + +Precondition Checks + Check resource instantiated + ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE + +Check Postcondition VNF Terminate + Check resource not Instantiated + +Create a new Grant - Sync - OPERATE + Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE + +Check Operation Notification For Operate + [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 2eaac649..735b2435 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -42,6 +42,11 @@ Check resource Instantiated Check HTTP Response Status Code Is 200 Check VNF Status ${response.body.instantiationState} INSTANTIATED +Check resource not Instantiated + Check VNF Instance ${vnfInstanceId} + Check HTTP Response Status Code Is 200 + Check VNF Status ${response.body.instantiationState} NOT_INSTANTIATED + Check VNF Instance [Arguments] ${vnfId} Set Headers {"Accept":"${ACCEPT}"} @@ -72,6 +77,11 @@ Get Vnf Operational State Info ${stateInfo}= Get Value From Json ${vnfInstance} $..vnfState [Return] ${stateInfo} +Get Vnf Ext Link Id + [Arguments] ${vnfInstanceId} + ${vnfInstance}= Get Vnf Instance ${vnfInstanceId} + [Return] ${vnfInstance.instantiatedVnfInfo.extVirtualLinkInfo.id} + Check HTTP Response Header Contains [Arguments] ${CONTENT_TYPE} Should Contain ${response.headers} ${CONTENT_TYPE} @@ -126,6 +136,30 @@ Send Change VNF Operational State Request Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File json/operateVnFRequest.json ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} + +Send Heal VNF Request + Log Trying to heal 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/healVnFRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} + +Send Change Ext Connectivity Request + Log Trying to change the external connectivity 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/changeExtVnfConnectivityRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} + +Send Terminate VNF Request + Log Trying to terminate 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/terminateVnFRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} Create a new Grant - Synchronous mode [Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation} -- GitLab