From e03ac559037a505a3081d3dfc26b584de8323617 Mon Sep 17 00:00:00 2001 From: Elian Kraja Date: Fri, 8 Mar 2019 17:59:45 +0100 Subject: [PATCH] Bug fixing: issues #14-#19, #21-#23, #28, #29 --- .../VNFConfiguration-API/Configuration.robot | 9 ++-- .../IndividualAlarm.robot | 37 ++++++++++------ .../environment/variables.txt | 4 +- .../CancelOperationTask.robot | 17 -------- .../ChangeExternalVNFConnectivityTask.robot | 22 +--------- .../ChangeVNFFlavourTask.robot | 20 --------- .../FailOperationTask.robot | 17 -------- .../HealVNFTask.robot | 20 --------- .../IndividualSubscription.robot | 2 +- .../IndividualVNFInstance.robot | 14 +++---- .../InstantiateVNFTask.robot | 2 +- .../LCMParallelOperation.robot | 40 ++++++++++++++++++ .../OperateVNFTask.robot | 26 ++---------- .../RetryOperationTask.robot | 18 -------- .../RollbackOperationTask.robot | 18 -------- .../ScaleVNFTask.robot | 19 --------- .../ScaleVNFToLevelTask.robot | 18 -------- .../Subscriptions.robot | 6 +-- .../TerminateVNFTask.robot | 20 --------- .../environment/variables.txt | 2 + .../IndividualAlarm.robot | 29 ++++++++----- .../ChangeExternalVNFConnectivityTask.robot | 20 --------- .../ChangeVNFFlavourTask.robot | 27 ++---------- .../FailOperationTask.robot | 18 +------- .../HealVNFTask.robot | 21 +--------- .../IndividualSubscription.robot | 2 +- .../IndividualVNFInstance.robot | 12 +++--- .../InstantiateVNFTask.robot | 2 +- .../LCMParallelOperation.robot | 42 +++++++++++++++++++ .../OperateVNFTask.robot | 27 ++---------- .../OperateVNFWorkflow.robot | 2 +- .../RetryOperationTask.robot | 18 -------- .../RollbackOperationTask.robot | 19 +-------- .../ScaleVNFTask.robot | 19 --------- .../ScaleVNFToLevelTask.robot | 18 -------- .../Subscriptions.robot | 6 +-- .../TerminateVNFTask.robot | 20 --------- .../VNFInstances.robot | 2 +- .../VnfLcmMntOperationKeywords.robot | 2 +- .../environment/variables.txt | 3 +- .../IndividualNSDescriptor.robot | 13 ++++-- .../NSFMOperationKeywords.robot | 2 +- .../environment/variables.txt | 4 +- 43 files changed, 188 insertions(+), 471 deletions(-) create mode 100644 SOL002/VNFLifecycleManagement-API/LCMParallelOperation.robot create mode 100644 SOL003/VNFLifecycleManagement-API/LCMParallelOperation.robot diff --git a/SOL002/VNFConfiguration-API/Configuration.robot b/SOL002/VNFConfiguration-API/Configuration.robot index 3120ea30..a6411336 100644 --- a/SOL002/VNFConfiguration-API/Configuration.robot +++ b/SOL002/VNFConfiguration-API/Configuration.robot @@ -18,7 +18,7 @@ Set new VNF Configuration ... Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration Send VNF configuration Check HTTP Response Status Code Is 200 - Check HTTP Response Header Contains Etag + Check HTTP Response Header Contains ETag Check HTTP Response Body Json Schema Is vnfConfigModifications.schema.json Check Postcondition VNF Is Configured @@ -48,7 +48,7 @@ Get information about a VNF configuration with HTTP Etag ... Post-Conditions: none Get VNF configuration Check HTTP Response Status Code Is 200 - Check HTTP Response Header Contains Etag + Check HTTP Response Header Contains ETag Check HTTP Response Body Json Schema Is vnfConfiguration.schema.json Set new VNF Configuration - HTTP Etag precondition unsuccessful @@ -121,6 +121,7 @@ Send VNF configuration Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/vnfConfigModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} + Set Suite Variable &{etag} ${response[0]['headers']['ETag']} ${output}= Output response Set Suite Variable @{response} ${output} @@ -158,11 +159,11 @@ Check Postcondition VNF Is Configured Should Be Equal ${response[0]['body']} ${input} Send Duplicated VNF configuration - Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified + Depends On Test Send VNF configuration # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Set Headers {"If-Match": "${Etag}"} + Set Headers {"If-Match": "${etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/vnfConfigModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} diff --git a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot index 43c1d675..ec2aa8ed 100644 --- a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot +++ b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot @@ -8,6 +8,10 @@ Library JSONSchemaLibrary schemas/ Library DependencyLibrary +*** Variables ** +${original_etag} 1234 + + *** Test Cases *** POST Alarm - Method not implemented log Trying to perform a POST. This method should not be implemented @@ -17,6 +21,7 @@ POST Alarm - Method not implemented Log Validate Status code Integer response status 405 + Get information about a configuration [Documentation] Test ID: 7.4.3.1 ... Test title: Get information about an alarm @@ -32,15 +37,17 @@ Get information about a configuration Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} - ${Etag}= Output response headers Etag Log Validate Status code Integer response status 200 + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} ${contentType}= Output response headers Content-Type Should Contain ${contentType} ${CONTENT_TYPE} ${result}= Output response body Validate Json alarm.schema.json ${result} Log Validation OK + PUT Alarm - Method not implemented log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept":"${ACCEPT}"} @@ -49,6 +56,7 @@ PUT Alarm - Method not implemented Log Validate Status code Integer response status 405 + PATCH Alarm [Documentation] Test ID: 7.4.3.2 ... Test title: Modify an individual alarm resource @@ -60,60 +68,63 @@ PATCH Alarm ... Post-Conditions: log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - ${Etag_modified}= Output response headers Etag Integer response status 200 ${contentType}= Output response headers Content-Type Should Contain ${contentType} ${CONTENT_TYPE} ${result}= Output response body Validate Json alarmModifications.schema.json ${result} Log Validation OK + -PATCH Alarm - Conflict + + +PATCH Alarm - Precondition failed [Documentation] Test ID: 7.4.3.2-1 - ... Test title: Modify an individual alarm resource - Conflict + ... Test title: Modify an individual alarm resource - Precondition failed ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists ... Reference: section 7.4.3 - SOL002 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: The alarm resource is not modified - Depends On Test PATCH Alarm # If the previous test scceeded, it means that the alarm is in ackownledged state + Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - Integer response status 409 + Integer response status 412 ${problemDetails}= Output response body Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -PATCH Alarm - Precondition failed +PATCH Alarm - Conflict [Documentation] Test ID: 7.4.3.2-1 - ... Test title: Modify an individual alarm resource - Precondition failed + ... Test title: Modify an individual alarm resource - Conflict ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists ... Reference: section 7.4.3 - SOL002 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: The alarm resource is not modified - Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified + Depends On Test PATCH Alarm # If the previous test scceeded, it means that the alarm is in ackownledged state log Trying to perform a PATCH. This method modifies an individual alarm resource - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - Integer response status 412 + Integer response status 409 ${problemDetails}= Output response body Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK diff --git a/SOL002/VNFFaultManagement-API/environment/variables.txt b/SOL002/VNFFaultManagement-API/environment/variables.txt index e3d485e8..fc5212d5 100644 --- a/SOL002/VNFFaultManagement-API/environment/variables.txt +++ b/SOL002/VNFFaultManagement-API/environment/variables.txt @@ -16,8 +16,8 @@ ${CONTENT_TYPE} application/json ${VNFM_DUPLICATION} 0 ${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${Etag}= an etag -${Etag_modified}= a modified etag +${etags} a modified etag +${wrong_etag} wrong-tag ${CONTENT_TYPE_PATCH} application/merge-patch+json ${PerceivedSeverity} CRITICAL diff --git a/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot b/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot index 0856f08e..8d7bd021 100644 --- a/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/CancelOperationTask.robot @@ -38,23 +38,6 @@ Post Cancel operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} 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 - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 diff --git a/SOL002/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot b/SOL002/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot index 0ddb0426..60be754d 100644 --- a/SOL002/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot +++ b/SOL002/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot @@ -21,27 +21,7 @@ Change external VNF connectivity Should Contain ${headers} Location Log Validation OK -Change external VNF connectivity 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 another LCM operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour 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 jsons/changeExtVnfConnectivityRequest .json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 - - + GET Change external VNF connectivity - Method not implemented log Trying to perform a GET. This method should not be implemented Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} diff --git a/SOL002/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot b/SOL002/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot index b1c238bf..1fd21f35 100644 --- a/SOL002/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot +++ b/SOL002/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot @@ -41,26 +41,6 @@ Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Change deployment flavour of a vnfInstance 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 in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/changeVnfFlavourRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Change deployment flavour of a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/FailOperationTask.robot b/SOL002/VNFLifecycleManagement-API/FailOperationTask.robot index 2e160b6c..684ec951 100644 --- a/SOL002/VNFLifecycleManagement-API/FailOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/FailOperationTask.robot @@ -41,23 +41,6 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Fail 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}/fail - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Fail operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot b/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot index d761cb34..52c76189 100644 --- a/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot @@ -41,26 +41,6 @@ Heal a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Heal a vnfInstance 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 in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - 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 jsons/healVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Heal a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot b/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot index 026a3a7d..7b5b22ac 100644 --- a/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot +++ b/SOL002/VNFLifecycleManagement-API/IndividualSubscription.robot @@ -50,7 +50,7 @@ DELETE an individual subscription log Try to delete an individual subscription Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} Log Validate Status code Integer response status 204 diff --git a/SOL002/VNFLifecycleManagement-API/IndividualVNFInstance.robot b/SOL002/VNFLifecycleManagement-API/IndividualVNFInstance.robot index cf1a04dc..73ab26ca 100644 --- a/SOL002/VNFLifecycleManagement-API/IndividualVNFInstance.robot +++ b/SOL002/VNFLifecycleManagement-API/IndividualVNFInstance.robot @@ -10,9 +10,9 @@ Documentation This resource represents an individual VNF instance. The client ... underlying VNF instance, and to read information about the VNF instance. Suite Setup Check resource existance + *** Variables *** -${Etag}= an etag -${Etag_modified}= a modified etag +${original_etag} 1234 *** Test Cases *** Post Individual VNFInstance - Method not implemented @@ -31,13 +31,14 @@ Get Information about an individual VNF Instance Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} Log Validate Status code - ${Etag}= Output response headers Etag Integer response status 200 ${contentType}= Output response headers Content-Type Should Contain ${contentType} ${CONTENT_TYPE} ${result}= Output response body Validate Json vnfInstance.schema.json ${result} Log Validation OK + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} PUT Individual VNFInstance - Method not implemented Log Trying to perform a PUT. This method should not be implemented @@ -56,12 +57,11 @@ PATCH Individual VNFInstance log Trying to modify an individual VNF instance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} Log Validate Status code - ${Etag_modified}= Output response headers Etag - Integer response status 202 ${headers}= Output response headers Should Contain ${headers} Location Log Validation OK @@ -75,7 +75,7 @@ PATCH Individual VNFInstance Precondition failed log Trying to modify an individual VNF instance Precondition failed Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} @@ -126,7 +126,7 @@ DELETE Individual VNFInstance Conflict [Setup] Check resource instantiated log Trying to delete an individual VNF instance Conflict Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId} Log Validate Status code Integer response status 409 ${contentType}= Output response headers Content-Type diff --git a/SOL002/VNFLifecycleManagement-API/InstantiateVNFTask.robot b/SOL002/VNFLifecycleManagement-API/InstantiateVNFTask.robot index 307b42a7..3d0c9f8f 100644 --- a/SOL002/VNFLifecycleManagement-API/InstantiateVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/InstantiateVNFTask.robot @@ -35,7 +35,7 @@ Instantiate a vnfInstance Conflict Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/instantiateVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId}/instantiate ${body} Integer response status 409 Log Status code validated ${contentType}= Output response headers Content-Type diff --git a/SOL002/VNFLifecycleManagement-API/LCMParallelOperation.robot b/SOL002/VNFLifecycleManagement-API/LCMParallelOperation.robot new file mode 100644 index 00000000..4effbe1b --- /dev/null +++ b/SOL002/VNFLifecycleManagement-API/LCMParallelOperation.robot @@ -0,0 +1,40 @@ +*** Settings *** +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +Scale a vnfInstance + [Documentation] Instantiate VNF The POST method instantiates a VNF instance. + Log Trying to Instantiate 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 jsons/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${conflicVnfInstanceId}/scale ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + +Scale a vnfInstance 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 in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + log Trying to Scale 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 jsons/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${conflicVnfInstanceId}/scale ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + Validate Json ProblemDetails.schema.json ${problemDetails} + Log Validation OK + diff --git a/SOL002/VNFLifecycleManagement-API/OperateVNFTask.robot b/SOL002/VNFLifecycleManagement-API/OperateVNFTask.robot index 77ae2f97..03557272 100644 --- a/SOL002/VNFLifecycleManagement-API/OperateVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/OperateVNFTask.robot @@ -13,7 +13,7 @@ Operate a vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 202 Log Status code validated @@ -33,7 +33,7 @@ Operate a vnfInstance Conflict (Not-Instantiated) Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 409 Log Status code validated @@ -41,26 +41,6 @@ Operate a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Operate a vnfInstance 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 in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the operational state 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 jsons/operateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Operate a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent @@ -73,7 +53,7 @@ Operate a vnfInstance Not Found Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 404 Log Status code validated diff --git a/SOL002/VNFLifecycleManagement-API/RetryOperationTask.robot b/SOL002/VNFLifecycleManagement-API/RetryOperationTask.robot index ce6afdd1..d98c4f16 100644 --- a/SOL002/VNFLifecycleManagement-API/RetryOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/RetryOperationTask.robot @@ -40,24 +40,6 @@ Post Retry operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Retry operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [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 rollback or fail. - ... 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 Retry an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Retry operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/RollbackOperationTask.robot b/SOL002/VNFLifecycleManagement-API/RollbackOperationTask.robot index 0e98a8fb..afd5d360 100644 --- a/SOL002/VNFLifecycleManagement-API/RollbackOperationTask.robot +++ b/SOL002/VNFLifecycleManagement-API/RollbackOperationTask.robot @@ -39,24 +39,6 @@ Post Rollback operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Rollback operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [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 fail. - ... 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 Rollback an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Rollback operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/ScaleVNFTask.robot b/SOL002/VNFLifecycleManagement-API/ScaleVNFTask.robot index 879d55fd..4fbb92b2 100644 --- a/SOL002/VNFLifecycleManagement-API/ScaleVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/ScaleVNFTask.robot @@ -40,25 +40,6 @@ Scale a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Scale a vnfInstance 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 in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale 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 jsons/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Scale a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot b/SOL002/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot index b1f5b464..775376c6 100644 --- a/SOL002/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot +++ b/SOL002/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot @@ -40,24 +40,6 @@ Scale a vnfInstance to level Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Scale a vnfInstance to level Conflict (parallel LCM operation) - [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 in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale 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 jsons/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Scale a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL002/VNFLifecycleManagement-API/Subscriptions.robot b/SOL002/VNFLifecycleManagement-API/Subscriptions.robot index c0a37afa..3c4e5590 100644 --- a/SOL002/VNFLifecycleManagement-API/Subscriptions.robot +++ b/SOL002/VNFLifecycleManagement-API/Subscriptions.robot @@ -11,7 +11,7 @@ Create a new subscription Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 201 Log Status code validated @@ -29,7 +29,7 @@ Create a new Subscription - DUPLICATION Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 201 Log Status code validated @@ -45,7 +45,7 @@ Create a new Subscription - NO-DUPLICATION Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 303 Log Status code validated diff --git a/SOL002/VNFLifecycleManagement-API/TerminateVNFTask.robot b/SOL002/VNFLifecycleManagement-API/TerminateVNFTask.robot index d7556a34..3f652ede 100644 --- a/SOL002/VNFLifecycleManagement-API/TerminateVNFTask.robot +++ b/SOL002/VNFLifecycleManagement-API/TerminateVNFTask.robot @@ -41,26 +41,6 @@ Terminate a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Terminate a vnfInstance 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 in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour 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 jsons/terminateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 GET Terminate VNFInstance - Method not implemented log Trying to perform a GET. This method should not be implemented diff --git a/SOL002/VNFLifecycleManagement-API/environment/variables.txt b/SOL002/VNFLifecycleManagement-API/environment/variables.txt index 4c78837e..b43c2b75 100644 --- a/SOL002/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL002/VNFLifecycleManagement-API/environment/variables.txt @@ -15,6 +15,8 @@ ${apiVersion} v1 ${AUTH_USAGE} 1 ${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX ${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${instantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f #Change with an instantiated vnfInstanceID +${conflicVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${vnfInstanceName} Test-VnfInstance ${vnfInstanceDescription} description vnf ${vnfInstanceDescription_Update} Updated description vnf diff --git a/SOL003/VNFFaultManagement-API/IndividualAlarm.robot b/SOL003/VNFFaultManagement-API/IndividualAlarm.robot index c860aa35..95f75985 100644 --- a/SOL003/VNFFaultManagement-API/IndividualAlarm.robot +++ b/SOL003/VNFFaultManagement-API/IndividualAlarm.robot @@ -8,6 +8,9 @@ Library JSONSchemaLibrary schemas/ Library DependencyLibrary +*** Variables *** +${original_etag} 1234 + *** Test Cases *** POST Alarm - Method not implemented log Trying to perform a POST. This method should not be implemented @@ -33,7 +36,8 @@ Get information about an alarm Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} - #${Etag}= Output response headers Etag + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} Log Validate Status code Integer response status 200 ${contentType}= Output response headers Content-Type @@ -61,12 +65,13 @@ PATCH Alarm ... Post-Conditions: log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - ${Etag_modified}= Output response headers Etag + ${Etag_modified}= Output response headers ETag Integer response status 200 ${contentType}= Output response headers Content-Type Should Contain ${contentType} ${CONTENT_TYPE} @@ -74,50 +79,52 @@ PATCH Alarm Validate Json AlarmModification.schema.json ${result} Log Validation OK -PATCH Alarm - Conflict +PATCH Alarm - Precondition failed [Documentation] Test ID: 7.4.3.2-1 - ... Test title: Modify an individual alarm resource - Conflict + ... Test title: Modify an individual alarm resource - Precondition failed ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists ... Reference: section 7.4.3 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: The alarm resource is not modified + Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - Integer response status 409 + Integer response status 412 ${problemDetails}= Output response body Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -PATCH Alarm - Precondition failed + +PATCH Alarm - Conflict [Documentation] Test ID: 7.4.3.2-1 - ... Test title: Modify an individual alarm resource - Precondition failed + ... Test title: Modify an individual alarm resource - Conflict ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists ... Reference: section 7.4.3 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: The alarm resource is not modified - Depends On Test PATCH Alarm # If the previous test scceeded, it means that Etag has been modified log Trying to perform a PATCH. This method modifies an individual alarm resource Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/alarmModifications.json Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Log Validate Status code - Integer response status 412 + Integer response status 409 ${problemDetails}= Output response body Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK + DELETE Alarm - Method not implemented log Trying to perform a DELETE. This method should not be implemented Set Headers {"Accept":"${ACCEPT}"} diff --git a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot index c767d88b..374c52c8 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot @@ -21,26 +21,6 @@ Change external VNF connectivity ${headers}= Output response headers Should Contain ${headers} Location Log Validation OK - -Change external VNF connectivity 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 another LCM operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour 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 jsons/changeExtVnfConnectivityRequest .json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 GET Change external VNF connectivity - Method not implemented diff --git a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot index 6d08b6df..fc2902c5 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot @@ -14,8 +14,7 @@ Change deployment flavour of a vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body_file}= Get File jsons/changeVnfFlavourRequest.json - ${body}= evaluate json.loads('''${body_file}''') json + ${body}= Get File jsons/changeVnfFlavourRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} Integer response status 202 Log Status code validated @@ -44,28 +43,8 @@ Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Change deployment flavour of a vnfInstance 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 in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour of a VNF instance. - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body_file}= Get File jsons/changeVnfFlavourRequest.json - ${body}= evaluate json.loads('''${body_file}''') json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 - + + Change deployment flavour of a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent [Documentation] Not Found diff --git a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot index 94dbab29..d008d1d3 100644 --- a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot @@ -40,23 +40,7 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Fail 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}/fail - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Fail operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot b/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot index c0115d04..92b4bd3d 100644 --- a/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot @@ -42,26 +42,7 @@ Heal a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Heal a vnfInstance 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 in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - 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 jsons/healVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 + Heal a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot b/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot index d59a4fc0..0273b05b 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot @@ -51,7 +51,7 @@ DELETE an individual subscription log Try to delete an individual subscription Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} Log Validate Status code Integer response status 204 diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot index 48c72009..69df8f63 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot @@ -12,8 +12,7 @@ Documentation This resource represents an individual VNF instance. The client Suite Setup Check resource existance *** Variables *** -${Etag}= an etag -${Etag_modified}= a modified etag +${original_etag} 1234 *** Test Cases *** Post Individual VNFInstance - Method not implemented @@ -38,6 +37,8 @@ Get Information about an individual VNF Instance ${result}= Output response body Validate Json vnfInstance.schema.json ${result} Log Validation OK + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} PUT Individual VNFInstance - Method not implemented log Trying to perform a PUT. This method should not be implemented @@ -56,11 +57,12 @@ PATCH Individual VNFInstance log Trying to modify an individual VNF instance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} Log Validate Status code - ${Etag_modified}= Output response headers Etag + ${Etag_modified}= Output response headers ETag Integer response status 202 ${headers}= Output response headers Should Contain ${headers} Location @@ -75,7 +77,7 @@ PATCH Individual VNFInstance Precondition failed log Trying to modify an individual VNF instance Precondition failed Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} - Set Headers {"If-Match": "${Etag}"} + Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/patchBodyRequest.json Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} @@ -122,7 +124,7 @@ DELETE Individual VNFInstance Conflict [Setup] Check resource instantiated log Trying to delete an individual VNF instance Conflict Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} + Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId} Log Validate Status code Integer response status 409 ${problemDetails}= Output response body diff --git a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot index 3859bdc9..b728e71d 100644 --- a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot @@ -36,7 +36,7 @@ Instantiate a vnfInstance Conflict Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/instantiateVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${instantiatedVnfInstanceId}/instantiate ${body} Integer response status 409 Log Status code validated ${problemDetails}= Output response body diff --git a/SOL003/VNFLifecycleManagement-API/LCMParallelOperation.robot b/SOL003/VNFLifecycleManagement-API/LCMParallelOperation.robot new file mode 100644 index 00000000..e4bb01b3 --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/LCMParallelOperation.robot @@ -0,0 +1,42 @@ +*** Settings *** +Resource environment/configuration.txt +Resource environment/variables.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +Scale a vnfInstance + [Documentation] Instantiate VNF The POST method instantiates a VNF instance. + Log Trying to Instantiate 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 jsons/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${conflicVnfInstanceId}/scale ${body} + Integer response status 202 + Log Status code validated + ${headers}= Output response headers + Should Contain ${headers} Location + Log Validation OK + + +Scale a vnfInstance 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 in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. + ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. + log Trying to Scale 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 jsons/scaleVnfRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${conflicVnfInstanceId}/scale ${body} + Integer response status 409 + Log Status code validated + ${problemDetails}= Output response body + Validate Json ProblemDetails.schema.json ${problemDetails} + Log Validation OK + diff --git a/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot index 17f2a76a..a4f5c940 100644 --- a/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot @@ -14,7 +14,7 @@ Operate a vnfInstance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 202 Log Status code validated @@ -34,7 +34,7 @@ Operate a vnfInstance Conflict (Not-Instantiated) Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 409 Log Status code validated @@ -42,26 +42,7 @@ Operate a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Operate a vnfInstance 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 in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the operational state 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 jsons/operateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 + Operate a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent @@ -74,7 +55,7 @@ Operate a vnfInstance Not Found Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Integer response status 404 Log Status code validated diff --git a/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot index b66dcca2..0c6a474f 100644 --- a/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot +++ b/SOL003/VNFLifecycleManagement-API/OperateVNFWorkflow.robot @@ -37,7 +37,7 @@ Operate a VNF Instance *** Keywords *** Initialize System Create Sessions - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json ${changeVnfOperateRequest}= evaluate json.loads('''${body}''') json ${requestedState}= Get Value From Json ${changeVnfOperateRequest} $..changeStateTo diff --git a/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot b/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot index 4be7f59f..20ea983a 100644 --- a/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot @@ -41,24 +41,6 @@ Post Retry operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Retry operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [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 rollback or fail. - ... 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 Retry an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Retry operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot b/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot index 2083c792..bfd7e64d 100644 --- a/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot @@ -40,24 +40,7 @@ Post Rollback operation task Conflict (Not-FAILED_TEMP) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Post Rollback operation task Conflict (parallel LCM operation) - # TODO: Need to set the pre-condition of the test - Depends on test Check resource FAILED_TEMP - [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 fail. - ... 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 Rollback an operation - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Rollback operation task Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot index d7dd5e74..28589121 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot @@ -41,25 +41,6 @@ Scale a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Scale a vnfInstance 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 in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale 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 jsons/scaleVnfRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} - Integer response status 409 - Log Status code validated - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Scale a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot index eb1231d6..4ba305f4 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot @@ -41,24 +41,6 @@ Scale a vnfInstance to level Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Scale a vnfInstance to level Conflict (parallel LCM operation) - [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 in NOT-INSTANTIATED state, or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to Scale 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 jsons/scaleVnfToLevelRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 Scale a vnfInstance Not Found # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent diff --git a/SOL003/VNFLifecycleManagement-API/Subscriptions.robot b/SOL003/VNFLifecycleManagement-API/Subscriptions.robot index ca7fd6af..87caa20c 100644 --- a/SOL003/VNFLifecycleManagement-API/Subscriptions.robot +++ b/SOL003/VNFLifecycleManagement-API/Subscriptions.robot @@ -12,7 +12,7 @@ Create a new subscription Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 201 Log Status code validated @@ -30,7 +30,7 @@ Create a new Subscription - DUPLICATION Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 201 Log Status code validated @@ -46,7 +46,7 @@ Create a new Subscription - NO-DUPLICATION Set Headers {"Accept": "${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/lccbSubscriptionRequest.json + ${body}= Get File jsons/lccnSubscriptionRequest.json Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} Integer response status 303 Log Status code validated diff --git a/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot index be6be400..783fb7ff 100644 --- a/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot @@ -42,26 +42,6 @@ Terminate a vnfInstance Conflict (Not-Instantiated) Validate Json ProblemDetails.schema.json ${problemDetails} Log Validation OK -Terminate a vnfInstance 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 in NOT-INSTANTIATED state, - ... or that another lifecycle management operation is ongoing. - ... The response body shall contain a ProblemDetails structure, in which the �detail� attribute should convey more information about the error. - [Setup] Launch another LCM operation - log Trying to change the deployment flavour 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 jsons/terminateVnFRequest.json - Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body} - Log Validate Status code - Integer response status 409 - ${problemDetails}= Output response body - Validate Json ProblemDetails.schema.json ${problemDetails} - 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 GET Terminate VNFInstance - Method not implemented log Trying to perform a GET. This method should not be implemented diff --git a/SOL003/VNFLifecycleManagement-API/VNFInstances.robot b/SOL003/VNFLifecycleManagement-API/VNFInstances.robot index cb6d825c..ec71cb3b 100644 --- a/SOL003/VNFLifecycleManagement-API/VNFInstances.robot +++ b/SOL003/VNFLifecycleManagement-API/VNFInstances.robot @@ -22,7 +22,7 @@ Create a new vnfInstance Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File jsons/createVnfRequest.json - Post ${apiRoot}${apiName}/${apiVersion}/vnf_instances ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body} Integer response status 201 Log Status code validated ${headers}= Output response headers diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index dc544d35..c36b188e 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -132,7 +132,7 @@ Send Change VNF Operational State Request Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${body}= Get File jsons/operateVnFRequest.json + ${body}= Get File jsons/operateVnfRequest.json ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body} Send Heal VNF Request diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index bf673fbf..b044c856 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -1,12 +1,13 @@ *** Variables *** ${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${instantiatedVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f #Change with an instantiated vnfInstanceID ${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d ${callback_endpoint} /notification ${callback_endpoint_fwd} /notification/check ${callback_port} 9091 ${callback_uri} http://localhost - +${conflicVnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${VnfLcmOperationOccurrenceNotification} {} ${VnfIdentifierCreationNotification} {} diff --git a/SOL005/NSDManagement-API/IndividualNSDescriptor.robot b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot index a5b5ce59..a0dada4e 100644 --- a/SOL005/NSDManagement-API/IndividualNSDescriptor.robot +++ b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot @@ -6,9 +6,11 @@ Resource environment/nsDescriptors.txt # Specific nsDescriptors Para Library OperatingSystem Library JSONLibrary Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} - Library JSONSchemaLibrary schemas/ + *** Variable *** +${original_etag} 1234 + *** Test Cases *** GET Single Network Service Descriptor [Documentation] The GET method reads information about an individual NS descriptor. @@ -26,6 +28,8 @@ GET Single Network Service Descriptor ${result}= Output response body Validate Json NsdInfo.schema.json ${result} Log Validation OK + ${etag} Output response header ETag + Set Suite Variable &{original_etag} ${etag} GET Single Network Service Descriptor (Negative: Not found) @@ -60,6 +64,7 @@ PATCH Single Network Service Descriptor - (Disabling a nsdInfo) Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Set Headers {"If-Match": "${original_etag[0]}"} ${body}= Get File jsons/NsdInfoModificationDisable.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId} ${body} @@ -83,7 +88,7 @@ PATCH Single Network Service Descriptor - (Enabling an previously disabled nsdIn Log Validation of NsdInfoModifications OK -PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previously enabled nsdInfo) +PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable a previously enabled nsdInfo) Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} @@ -104,13 +109,13 @@ PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previous Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be modified by another entity Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - Set Headers {"If-Match": "${Etag}"} + Set Headers {"If-Match": "${original_etag[0]}"} ${body}= Get File jsons/NsdInfoModificationEnable.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${modifiedNsdInfoId} ${body} Integer response status 412 Log Received 412 Precondition failed as expected - ${returned_etag}= Output response headers Etag + ${returned_etag}= Output response headers ETag Log Verify different etags Should Not Be Equal ${Etag} ${returned_etag} ${contentType}= Output response headers Content-Type diff --git a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot index 58a27927..27fe2485 100644 --- a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot +++ b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot @@ -4,7 +4,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} Library JSONLibrary Library JSONSchemaLibrary schemas/ Library OperatingSystem -Suite Teardown Terminate All Processes kill=true +#Suite Teardown Terminate All Processes kill=true Library MockServerLibrary Library Process diff --git a/SOL005/NSFaultManagement-API/environment/variables.txt b/SOL005/NSFaultManagement-API/environment/variables.txt index f13d6bfe..319dd27b 100644 --- a/SOL005/NSFaultManagement-API/environment/variables.txt +++ b/SOL005/NSFaultManagement-API/environment/variables.txt @@ -40,7 +40,7 @@ ${AlarmListRebuiltNotification} {} ${response} {} -&{req_mock} {} -&{resp_mock} {} +${req_mock} {} +${resp_mock} {} -- GitLab