Commit e03ac559 authored by Elian Kraja's avatar Elian Kraja
Browse files

Bug fixing: issues #14-#19, #21-#23, #28, #29

parent 9fc274a4
...@@ -18,7 +18,7 @@ Set new VNF Configuration ...@@ -18,7 +18,7 @@ Set new VNF Configuration
... Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration ... Post-Conditions: The configuration is successfully set in the VNF and it matches the issued configuration
Send VNF configuration Send VNF configuration
Check HTTP Response Status Code Is 200 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 HTTP Response Body Json Schema Is vnfConfigModifications.schema.json
Check Postcondition VNF Is Configured Check Postcondition VNF Is Configured
...@@ -48,7 +48,7 @@ Get information about a VNF configuration with HTTP Etag ...@@ -48,7 +48,7 @@ Get information about a VNF configuration with HTTP Etag
... Post-Conditions: none ... Post-Conditions: none
Get VNF configuration Get VNF configuration
Check HTTP Response Status Code Is 200 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 Check HTTP Response Body Json Schema Is vnfConfiguration.schema.json
Set new VNF Configuration - HTTP Etag precondition unsuccessful Set new VNF Configuration - HTTP Etag precondition unsuccessful
...@@ -121,6 +121,7 @@ Send VNF configuration ...@@ -121,6 +121,7 @@ Send VNF configuration
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/vnfConfigModifications.json ${body}= Get File jsons/vnfConfigModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body}
Set Suite Variable &{etag} ${response[0]['headers']['ETag']}
${output}= Output response ${output}= Output response
Set Suite Variable @{response} ${output} Set Suite Variable @{response} ${output}
...@@ -158,11 +159,11 @@ Check Postcondition VNF Is Configured ...@@ -158,11 +159,11 @@ Check Postcondition VNF Is Configured
Should Be Equal ${response[0]['body']} ${input} Should Be Equal ${response[0]['body']} ${input}
Send Duplicated VNF configuration 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 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}"} 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}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/vnfConfigModifications.json ${body}= Get File jsons/vnfConfigModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body} Patch ${apiRoot}/${apiName}/${apiVersion}/configuration ${body}
......
...@@ -8,6 +8,10 @@ Library JSONSchemaLibrary schemas/ ...@@ -8,6 +8,10 @@ Library JSONSchemaLibrary schemas/
Library DependencyLibrary Library DependencyLibrary
*** Variables **
${original_etag} 1234
*** Test Cases *** *** Test Cases ***
POST Alarm - Method not implemented POST Alarm - Method not implemented
log Trying to perform a POST. This method should not be implemented log Trying to perform a POST. This method should not be implemented
...@@ -17,6 +21,7 @@ POST Alarm - Method not implemented ...@@ -17,6 +21,7 @@ POST Alarm - Method not implemented
Log Validate Status code Log Validate Status code
Integer response status 405 Integer response status 405
Get information about a configuration Get information about a configuration
[Documentation] Test ID: 7.4.3.1 [Documentation] Test ID: 7.4.3.1
... Test title: Get information about an alarm ... Test title: Get information about an alarm
...@@ -32,15 +37,17 @@ Get information about a configuration ...@@ -32,15 +37,17 @@ Get information about a configuration
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Execute Query and validate response Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} Get ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId}
${Etag}= Output response headers Etag
Log Validate Status code Log Validate Status code
Integer response status 200 Integer response status 200
${etag} Output response header ETag
Set Suite Variable &{original_etag} ${etag}
${contentType}= Output response headers Content-Type ${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE} Should Contain ${contentType} ${CONTENT_TYPE}
${result}= Output response body ${result}= Output response body
Validate Json alarm.schema.json ${result} Validate Json alarm.schema.json ${result}
Log Validation OK Log Validation OK
PUT Alarm - Method not implemented PUT Alarm - Method not implemented
log Trying to perform a PUT. This method should not be implemented log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Accept":"${ACCEPT}"}
...@@ -49,6 +56,7 @@ PUT Alarm - Method not implemented ...@@ -49,6 +56,7 @@ PUT Alarm - Method not implemented
Log Validate Status code Log Validate Status code
Integer response status 405 Integer response status 405
PATCH Alarm PATCH Alarm
[Documentation] Test ID: 7.4.3.2 [Documentation] Test ID: 7.4.3.2
... Test title: Modify an individual alarm resource ... Test title: Modify an individual alarm resource
...@@ -61,11 +69,11 @@ PATCH Alarm ...@@ -61,11 +69,11 @@ PATCH Alarm
log Trying to perform a PATCH. This method modifies an individual alarm resource 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 {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Set Headers {"If-Match": "${original_etag[0]}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/alarmModifications.json ${body}= Get File jsons/alarmModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body}
Log Validate Status code Log Validate Status code
${Etag_modified}= Output response headers Etag
Integer response status 200 Integer response status 200
${contentType}= Output response headers Content-Type ${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE} Should Contain ${contentType} ${CONTENT_TYPE}
...@@ -73,47 +81,50 @@ PATCH Alarm ...@@ -73,47 +81,50 @@ PATCH Alarm
Validate Json alarmModifications.schema.json ${result} Validate Json alarmModifications.schema.json ${result}
Log Validation OK Log Validation OK
PATCH Alarm - Conflict
PATCH Alarm - Precondition failed
[Documentation] Test ID: 7.4.3.2-1 [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 ... Test objective: The objective is to Modify an individual alarm resource
... Pre-conditions: The related alarm exists ... Pre-conditions: The related alarm exists
... Reference: section 7.4.3 - SOL002 v2.4.1 ... Reference: section 7.4.3 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM ... Config ID: Config_prod_VNFM
... Applicability: ... Applicability:
... Post-Conditions: The alarm resource is not modified ... 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 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 {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Set Headers {"If-Match": "${original_etag[0]}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/alarmModifications.json ${body}= Get File jsons/alarmModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body}
Log Validate Status code Log Validate Status code
Integer response status 409 Integer response status 412
${problemDetails}= Output response body ${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails} Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK Log Validation OK
PATCH Alarm - Precondition failed PATCH Alarm - Conflict
[Documentation] Test ID: 7.4.3.2-1 [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 ... Test objective: The objective is to Modify an individual alarm resource
... Pre-conditions: The related alarm exists ... Pre-conditions: The related alarm exists
... Reference: section 7.4.3 - SOL002 v2.4.1 ... Reference: section 7.4.3 - SOL002 v2.4.1
... Config ID: Config_prod_VNFM ... Config ID: Config_prod_VNFM
... Applicability: ... Applicability:
... Post-Conditions: The alarm resource is not modified ... 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 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 {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Set Headers {"If-Match": "${Etag}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/alarmModifications.json ${body}= Get File jsons/alarmModifications.json
Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body} Patch ${apiRoot}/${apiName}/${apiVersion}/alarms/${alarmId} ${body}
Log Validate Status code Log Validate Status code
Integer response status 412 Integer response status 409
${problemDetails}= Output response body ${problemDetails}= Output response body
Validate Json ProblemDetails.schema.json ${problemDetails} Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK Log Validation OK
......
...@@ -16,8 +16,8 @@ ${CONTENT_TYPE} application/json ...@@ -16,8 +16,8 @@ ${CONTENT_TYPE} application/json
${VNFM_DUPLICATION} 0 ${VNFM_DUPLICATION} 0
${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d ${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d
${Etag}= an etag ${etags} a modified etag
${Etag_modified}= a modified etag ${wrong_etag} wrong-tag
${CONTENT_TYPE_PATCH} application/merge-patch+json ${CONTENT_TYPE_PATCH} application/merge-patch+json
${PerceivedSeverity} CRITICAL ${PerceivedSeverity} CRITICAL
......
...@@ -38,23 +38,6 @@ Post Cancel operation task Conflict (Not-FAILED_TEMP) ...@@ -38,23 +38,6 @@ Post Cancel operation task Conflict (Not-FAILED_TEMP)
Validate Json ProblemDetails.schema.json ${problemDetails} Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK 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 Post Cancel operation task Not Found
# TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
......
...@@ -21,26 +21,6 @@ Change external VNF connectivity ...@@ -21,26 +21,6 @@ Change external VNF connectivity
Should Contain ${headers} Location Should Contain ${headers} Location
Log Validation OK 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 GET Change external VNF connectivity - Method not implemented
log Trying to perform a GET. This method should not be implemented log Trying to perform a GET. This method should not be implemented
......
...@@ -41,26 +41,6 @@ Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) ...@@ -41,26 +41,6 @@ Change deployment flavour of a vnfInstance Conflict (Not-Instantiated)
Validate Json ProblemDetails.schema.json ${problemDetails} Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK 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 Change deployment flavour of a vnfInstance Not Found
# TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
......
...@@ -41,23 +41,6 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) ...@@ -41,23 +41,6 @@ Post Fail operation task Conflict (Not-FAILED_TEMP)
Validate Json ProblemDetails.schema.json ${problemDetails} Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK 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 Post Fail operation task Not Found
# TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
......
...@@ -41,26 +41,6 @@ Heal a vnfInstance Conflict (Not-Instantiated) ...@@ -41,26 +41,6 @@ Heal a vnfInstance Conflict (Not-Instantiated)
Validate Json ProblemDetails.schema.json ${problemDetails} Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK 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 Heal a vnfInstance Not Found
# TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent # TODO: Need to create a vnfInstance which's instantiatedVnfInfo.scaleStatus is absent
......
...@@ -50,7 +50,7 @@ DELETE an individual subscription ...@@ -50,7 +50,7 @@ DELETE an individual subscription
log Try to delete an individual subscription log Try to delete an individual subscription
Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} 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 Log Validate Status code
Integer response status 204 Integer response status 204
......
...@@ -10,9 +10,9 @@ Documentation This resource represents an individual VNF instance. The client ...@@ -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. ... underlying VNF instance, and to read information about the VNF instance.
Suite Setup Check resource existance Suite Setup Check resource existance
*** Variables *** *** Variables ***
${Etag}= an etag ${original_etag} 1234
${Etag_modified}= a modified etag
*** Test Cases *** *** Test Cases ***
Post Individual VNFInstance - Method not implemented Post Individual VNFInstance - Method not implemented
...@@ -31,13 +31,14 @@ Get Information about an individual VNF Instance ...@@ -31,13 +31,14 @@ Get Information about an individual VNF Instance
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}
Log Validate Status code Log Validate Status code
${Etag}= Output response headers Etag
Integer response status 200 Integer response status 200
${contentType}= Output response headers Content-Type ${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE} Should Contain ${contentType} ${CONTENT_TYPE}
${result}= Output response body ${result}= Output response body
Validate Json vnfInstance.schema.json ${result} Validate Json vnfInstance.schema.json ${result}
Log Validation OK Log Validation OK
${etag} Output response header ETag
Set Suite Variable &{original_etag} ${etag}
PUT Individual VNFInstance - Method not implemented PUT Individual VNFInstance - Method not implemented
Log Trying to perform a PUT. This method should not be implemented Log Trying to perform a PUT. This method should not be implemented
...@@ -56,12 +57,11 @@ PATCH Individual VNFInstance ...@@ -56,12 +57,11 @@ PATCH Individual VNFInstance
log Trying to modify an individual VNF instance log Trying to modify an individual VNF instance
Set Headers {"Accept":"${ACCEPT}"} 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}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/patchBodyRequest.json ${body}= Get File jsons/patchBodyRequest.json
Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body}
Log Validate Status code Log Validate Status code
${Etag_modified}= Output response headers Etag
Integer response status 202
${headers}= Output response headers ${headers}= Output response headers
Should Contain ${headers} Location Should Contain ${headers} Location
Log Validation OK Log Validation OK
...@@ -75,7 +75,7 @@ PATCH Individual VNFInstance Precondition failed ...@@ -75,7 +75,7 @@ PATCH Individual VNFInstance Precondition failed
log Trying to modify an individual VNF instance Precondition failed log Trying to modify an individual VNF instance Precondition failed
Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} 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}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/patchBodyRequest.json ${body}= Get File jsons/patchBodyRequest.json
Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body} Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body}
...@@ -126,7 +126,7 @@ DELETE Individual VNFInstance Conflict ...@@ -126,7 +126,7 @@ DELETE Individual VNFInstance Conflict
[Setup] Check resource instantiated [Setup] Check resource instantiated
log Trying to delete an individual VNF instance Conflict log Trying to delete an individual VNF instance Conflict
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} 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 Log Validate Status code
Integer response status 409 Integer response status 409
${contentType}= Output response headers Content-Type ${contentType}= Output response headers Content-Type
......
...@@ -35,7 +35,7 @@ Instantiate a vnfInstance Conflict ...@@ -35,7 +35,7 @@ Instantiate a vnfInstance Conflict
Set Headers {"Content-Type": "${CONTENT_TYPE}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/instantiateVnfRequest.json ${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 Integer response status 409
Log Status code validated Log Status code validated
${contentType}= Output response headers Content-Type ${contentType}= Output response headers Content-Type
......
*** 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