Commit f7e471a8 authored by mengxuan.zhao's avatar mengxuan.zhao
Browse files

SOL003 VNF LCM add response body schema

parent 26db3c3a
...@@ -3,6 +3,8 @@ Resource variables.txt ...@@ -3,6 +3,8 @@ Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT} Library REST http://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFLifecycleManagement-API.yaml ... spec=SOL003-VNFLifecycleManagement-API.yaml
Library DependencyLibrary Library DependencyLibrary
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Documentation This task resource represents the "Cancel operation" operation. The client can use this resource to cancel an ongoing VNF lifecycle operation. Documentation This task resource represents the "Cancel operation" operation. The client can use this resource to cancel an ongoing VNF lifecycle operation.
Suite setup Check resource existance Suite setup Check resource existance
...@@ -14,14 +16,11 @@ Post Cancel operation task ...@@ -14,14 +16,11 @@ Post Cancel operation task
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Cancel a VNF lifecycle operation Log Cancel a VNF lifecycle operation
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel ${CancelMode} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/cancel ${CancelMode}
Output response
Log Validate Status code Log Validate Status code
Integer response status 202 Integer response status 202
${headers}= Output response headers
Check resource FAILED_TEMP Should Contain ${headers} Location
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Log Validation OK
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
String response body operationState FAILED_TEMP
Post Fail operation task Conflict (Not-FAILED_TEMP) Post Fail operation task Conflict (Not-FAILED_TEMP)
# TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state
...@@ -34,9 +33,12 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) ...@@ -34,9 +33,12 @@ Post Fail operation task Conflict (Not-FAILED_TEMP)
Log Final Fail an operation Log Final Fail an operation
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail
Output response
Integer response status 409 Integer response status 409
Log Status code validated Log Status code validated
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
Post Fail operation task Conflict (parallel LCM operation) Post Fail operation task Conflict (parallel LCM operation)
# TODO: Need to set the pre-condition of the test # TODO: Need to set the pre-condition of the test
...@@ -50,8 +52,11 @@ Post Fail operation task Conflict (parallel LCM operation) ...@@ -50,8 +52,11 @@ Post Fail operation task Conflict (parallel LCM operation)
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 409 Integer response status 409
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished [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
...@@ -67,15 +72,17 @@ Post Fail operation task Not Found ...@@ -67,15 +72,17 @@ Post Fail operation task Not Found
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 409 Integer response status 409
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET Fail operation task - Method not implemented GET Fail operation task - 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
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_lcm_op_occs/${vnfInstanceId}/fail Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
PUT Fail operation task - Method not implemented PUT Fail operation task - Method not implemented
...@@ -83,7 +90,6 @@ PUT Fail operation task - Method not implemented ...@@ -83,7 +90,6 @@ PUT Fail operation task - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
PATCH Fail operation task - Method not implemented PATCH Fail operation task - Method not implemented
...@@ -91,7 +97,6 @@ PATCH Fail operation task - Method not implemented ...@@ -91,7 +97,6 @@ PATCH Fail operation task - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
DELETE Fail operation task - Method not implemented DELETE Fail operation task - Method not implemented
...@@ -99,7 +104,6 @@ DELETE Fail operation task - Method not implemented ...@@ -99,7 +104,6 @@ DELETE Fail operation task - Method not implemented
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_lcm_op_occs/${vnfInstanceId}/fail Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
*** Key words *** *** Key words ***
...@@ -117,4 +121,10 @@ Launch another error handling action ...@@ -117,4 +121,10 @@ Launch another error handling action
Check Fail not supported Check Fail not supported
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_lcm_op_occs/${vnfLcmOpOccId} Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
# how to check if Fail is not supported? # how to check if Fail is not supported?
\ No newline at end of file
Check resource FAILED_TEMP
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
String response body operationState FAILED_TEMP
\ No newline at end of file
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
Resource variables.txt Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT} Library REST http://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFLifecycleManagement-API.yaml ... spec=SOL003-VNFLifecycleManagement-API.yaml
Library OperatingSystem Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite setup Check resource existance Suite setup Check resource existance
*** Test Cases *** *** Test Cases ***
...@@ -16,6 +18,9 @@ Change external VNF connectivity ...@@ -16,6 +18,9 @@ Change external VNF connectivity
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body}
Integer response status 202 Integer response status 202
Log Status code validated Log Status code validated
${headers}= Output response headers
Should Contain ${headers} Location
Log Validation OK
Change external VNF connectivity Conflict (parallel LCM operation) Change external VNF connectivity Conflict (parallel LCM operation)
# TODO: Need to set the pre-condition of the test # TODO: Need to set the pre-condition of the test
...@@ -31,8 +36,11 @@ Change external VNF connectivity Conflict (parallel LCM operation) ...@@ -31,8 +36,11 @@ Change external VNF connectivity Conflict (parallel LCM operation)
${body}= Get File json/changeExtVnfConnectivityRequest .json ${body}= Get File json/changeExtVnfConnectivityRequest .json
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body}
Log Validate Status code Log Validate Status code
Output response
Integer response status 409 Integer response status 409
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished [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
...@@ -41,7 +49,6 @@ GET Change external VNF connectivity - Method not implemented ...@@ -41,7 +49,6 @@ GET Change external VNF connectivity - Method not implemented
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}/change_ext_conn Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
PUT Change external VNF connectivity - Method not implemented PUT Change external VNF connectivity - Method not implemented
...@@ -49,7 +56,6 @@ PUT Change external VNF connectivity - Method not implemented ...@@ -49,7 +56,6 @@ PUT Change external VNF connectivity - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
PATCH Change external VNF connectivity - Method not implemented PATCH Change external VNF connectivity - Method not implemented
...@@ -57,7 +63,6 @@ PATCH Change external VNF connectivity - Method not implemented ...@@ -57,7 +63,6 @@ PATCH Change external VNF connectivity - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
DELETE Change external VNF connectivity - Method not implemented DELETE Change external VNF connectivity - Method not implemented
...@@ -65,7 +70,6 @@ DELETE Change external VNF connectivity - Method not implemented ...@@ -65,7 +70,6 @@ DELETE Change external VNF connectivity - Method not implemented
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}/change_ext_conn Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
*** Key words *** *** Key words ***
......
...@@ -3,6 +3,8 @@ Resource variables.txt ...@@ -3,6 +3,8 @@ Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT} Library REST http://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFLifecycleManagement-API.yaml ... spec=SOL003-VNFLifecycleManagement-API.yaml
Library OperatingSystem Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite setup Check resource existance Suite setup Check resource existance
*** Test Cases *** *** Test Cases ***
...@@ -16,6 +18,9 @@ Change deployment flavour of a vnfInstance ...@@ -16,6 +18,9 @@ Change deployment flavour of a vnfInstance
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body}
Integer response status 202 Integer response status 202
Log Status code validated Log Status code validated
${headers}= Output response headers
Should Contain ${headers} Location
Log Validation OK
Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) Change deployment flavour of a vnfInstance Conflict (Not-Instantiated)
# TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state
...@@ -31,9 +36,12 @@ Change deployment flavour of a vnfInstance Conflict (Not-Instantiated) ...@@ -31,9 +36,12 @@ Change deployment flavour of a vnfInstance Conflict (Not-Instantiated)
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/changeVnfFlavourRequest.json ${body}= Get File json/changeVnfFlavourRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body}
Output response
Integer response status 409 Integer response status 409
Log Status code validated Log Status code validated
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
Change deployment flavour of a vnfInstance Conflict (parallel LCM operation) Change deployment flavour of a vnfInstance Conflict (parallel LCM operation)
# TODO: Need to set the pre-condition of the test # TODO: Need to set the pre-condition of the test
...@@ -50,8 +58,11 @@ Change deployment flavour of a vnfInstance Conflict (parallel LCM operation) ...@@ -50,8 +58,11 @@ Change deployment flavour of a vnfInstance Conflict (parallel LCM operation)
${body}= Get File json/changeVnfFlavourRequest.json ${body}= Get File json/changeVnfFlavourRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body}
Log Validate Status code Log Validate Status code
Output response
Integer response status 409 Integer response status 409
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished [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
...@@ -69,6 +80,10 @@ Change deployment flavour of a vnfInstance Not Found ...@@ -69,6 +80,10 @@ Change deployment flavour of a vnfInstance Not Found
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body}
Integer response status 404 Integer response status 404
Log Status code validated Log Status code validated
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET Change deployment flavour VNFInstance - Method not implemented GET Change deployment flavour VNFInstance - Method not implemented
...@@ -76,7 +91,6 @@ GET Change deployment flavour VNFInstance - Method not implemented ...@@ -76,7 +91,6 @@ GET Change deployment flavour VNFInstance - Method not implemented
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}/change_flavour Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
PUT Change deployment flavour VNFInstance - Method not implemented PUT Change deployment flavour VNFInstance - Method not implemented
...@@ -84,7 +98,6 @@ PUT Change deployment flavour VNFInstance - Method not implemented ...@@ -84,7 +98,6 @@ PUT Change deployment flavour VNFInstance - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
PATCH Change deployment flavour VNFInstance - Method not implemented PATCH Change deployment flavour VNFInstance - Method not implemented
...@@ -92,7 +105,6 @@ PATCH Change deployment flavour VNFInstance - Method not implemented ...@@ -92,7 +105,6 @@ PATCH Change deployment flavour VNFInstance - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
DELETE Change deployment flavour VNFInstance - Method not implemented DELETE Change deployment flavour VNFInstance - Method not implemented
...@@ -100,7 +112,6 @@ DELETE Change deployment flavour VNFInstance - Method not implemented ...@@ -100,7 +112,6 @@ DELETE Change deployment flavour VNFInstance - Method not implemented
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}/change_flavour Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
*** Key words *** *** Key words ***
......
...@@ -3,6 +3,8 @@ Resource variables.txt ...@@ -3,6 +3,8 @@ Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT} Library REST http://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFLifecycleManagement-API.yaml ... spec=SOL003-VNFLifecycleManagement-API.yaml
Library DependencyLibrary Library DependencyLibrary
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Documentation This task resource represents the "Fail operation" operation. Documentation This task resource represents the "Fail operation" operation.
... The client can use this resource to mark a VNF lifecycle management operation occurrence as "finally failed", ... The client can use this resource to mark a VNF lifecycle management operation occurrence as "finally failed",
... i.e. change the state of the related VNF LCM operation occurrence resource to "FAILED", if it is not assumed that a subsequent retry or rollback will succeed. ... i.e. change the state of the related VNF LCM operation occurrence resource to "FAILED", if it is not assumed that a subsequent retry or rollback will succeed.
...@@ -19,11 +21,9 @@ Post Fail operation task ...@@ -19,11 +21,9 @@ Post Fail operation task
Output response Output response
Log Validate Status code Log Validate Status code
Integer response status 202 Integer response status 202
${headers}= Output response headers
Check resource FAILED_TEMP Should Contain ${headers} Location
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Log Validation OK
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
String response body operationState FAILED_TEMP
Post Fail operation task Conflict (Not-FAILED_TEMP) Post Fail operation task Conflict (Not-FAILED_TEMP)
# TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state
...@@ -36,9 +36,12 @@ Post Fail operation task Conflict (Not-FAILED_TEMP) ...@@ -36,9 +36,12 @@ Post Fail operation task Conflict (Not-FAILED_TEMP)
Log Final Fail an operation Log Final Fail an operation
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail
Output response
Integer response status 409 Integer response status 409
Log Status code validated Log Status code validated
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
Post Fail operation task Conflict (parallel LCM operation) Post Fail operation task Conflict (parallel LCM operation)
# TODO: Need to set the pre-condition of the test # TODO: Need to set the pre-condition of the test
...@@ -52,8 +55,11 @@ Post Fail operation task Conflict (parallel LCM operation) ...@@ -52,8 +55,11 @@ Post Fail operation task Conflict (parallel LCM operation)
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 409 Integer response status 409
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
[Teardown] #We cannot know if the "scale" operation is finished easily because the 202 indicates only whether the operation has been accepted, not whether the operation has been finished [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
...@@ -69,15 +75,17 @@ Post Fail operation task Not Found ...@@ -69,15 +75,17 @@ Post Fail operation task Not Found
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 409 Integer response status 409
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET Fail operation task - Method not implemented GET Fail operation task - 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
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_lcm_op_occs/${vnfInstanceId}/fail Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
PUT Fail operation task - Method not implemented PUT Fail operation task - Method not implemented
...@@ -85,7 +93,6 @@ PUT Fail operation task - Method not implemented ...@@ -85,7 +93,6 @@ PUT Fail operation task - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail Put ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
PATCH Fail operation task - Method not implemented PATCH Fail operation task - Method not implemented
...@@ -93,7 +100,6 @@ PATCH Fail operation task - Method not implemented ...@@ -93,7 +100,6 @@ PATCH Fail operation task - Method not implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
DELETE Fail operation task - Method not implemented DELETE Fail operation task - Method not implemented
...@@ -101,7 +107,6 @@ DELETE Fail operation task - Method not implemented ...@@ -101,7 +107,6 @@ DELETE Fail operation task - Method not implemented
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_lcm_op_occs/${vnfInstanceId}/fail Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfInstanceId}/fail
Log Validate Status code Log Validate Status code
Output response
Integer response status 405 Integer response status 405
*** Key words *** *** Key words ***
...@@ -119,4 +124,9 @@ Launch another error handling action ...@@ -119,4 +124,9 @@ Launch another error handling action
Check Fail not supported Check Fail not supported
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_lcm_op_occs/${vnfLcmOpOccId} Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
# how to check if Fail is not supported? # how to check if Fail is not supported?
\ No newline at end of file
Check resource FAILED_TEMP
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
String response body operationState FAILED_TEMP
\ No newline at end of file
...@@ -3,6 +3,8 @@ Resource variables.txt ...@@ -3,6 +3,8 @@ Resource variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT} Library REST http://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFLifecycleManagement-API.yaml ... spec=SOL003-VNFLifecycleManagement-API.yaml
Library OperatingSystem Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Suite setup Check resource existance Suite setup Check resource existance
*** Test Cases *** *** Test Cases ***
...@@ -16,6 +18,9 @@ Heal a vnfInstance ...@@ -16,6 +18,9 @@ Heal a vnfInstance
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body} Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body}
Integer response status 202 Integer response status 202
Log Status code validated Log Status code validated
${headers}= Output response headers
Should Contain ${headers} Location
Log Validation OK
Heal a vnfInstance Conflict (Not-Instantiated) Heal a vnfInstance Conflict (Not-Instantiated)
# TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state # TODO: Need to set the pre-condition of the test. VNF instance shall be in INSTANTIATED state
...@@ -31,9 +36,12 @@ Heal a vnfInstance Conflict (Not-Instantiated)