Newer
Older
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false
Library OperatingSystem
Library BuiltIn
Library JSONLibrary
Library Collections
Library JSONSchemaLibrary schemas/
Library String
Library Process
*** Keywords ***
Get Vnf Instance
[Arguments] ${vnfInstanceId}
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}
${body}= Output response body
[Return] ${body}
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Should Be Equal As Strings ${response['status']} ${expected_status}
Log Status code validated
Check Operation Occurrence Id
${vnfLcmOpOccId}= Get Value From Json ${response['headers']} $..Location
Should Not Be Empty ${vnfLcmOpOccId}
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
${schema} = Catenate SEPARATOR= ${input} .schema.json
Log Json Schema Validation OK
Check resource Instantiated
Check VNF Instance ${vnfInstanceId}
Check HTTP Response Status Code Is 200
Check VNF Status ${response['body']['instantiationState']} INSTANTIATED
Check resource not Instantiated
Check VNF Instance ${vnfInstanceId}
Check HTTP Response Status Code Is 200
Check VNF Status ${response['body']['instantiationState']} NOT_INSTANTIATED
Check VNF Instance
[Arguments] ${vnfId}
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${response}= Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfId}
Check VNF Status
[Arguments] ${current} ${expected}
Should Be Equal As Strings ${current} ${expected}
Log VNF Status in the correct status
Check operation resource state is FAILED_TEMP
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
String response body instantiationState FAILED_TEMP
Check operation resource state is FINALLY_FAILED
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}
String response body instantiationState FINALLY_FAILED
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Log Header is present
POST Create a new vnfInstance
Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${body}= Get File jsons/createVnfRequest.json
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body}
${outputResponse}= Output response
GET multiple vnfInstances
Log Query VNF The GET method queries information about multiple VNF instances.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances
${outputResponse}= Output response
GET multiple vnfInstances with bad attribute
Log Query VNF The GET method queries information about multiple VNF instances.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?attribute_not_exist=some_value
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
GET multiple vnfInstances with bad filter
Log Query VNF The GET method queries information about multiple VNF instances.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?fields=wrong_field
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
GET multiple vnfInstances with all_fields attribute selector
Log Query status information about multiple VNF instances, using fields
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?exclude_default
${output}= Output response
Set Suite Variable ${response} ${output}
GET multiple vnfInstances with exclude_default attribute selector
Log Query status information about multiple VNF instances using fields
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?exclude_default
${output}= Output response
Set Suite Variable ${response} ${output}
GET multiple vnfInstances with fields attribute selector
Log Query status information about multiple VNF instances, using fields
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?fields=${fields}
${output}= Output response
Set Suite Variable ${response} ${output}
GET multiple vnfInstances with exclude_fields attribute selector
Log Query status information about multiple VNF instances, using fields
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_instances?exclude_fields=${fields}
${output}= Output response
Set Suite Variable ${response} ${output}
PUT multiple vnfInstances
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
PATCH multiple vnfInstances
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfLcmOpOccId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
DELETE multiple vnfInstances
Log Trying to perform a DELETE. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfLcmOpOccId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
POST individual vnfInstance
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
GET individual vnfInstance
log Trying to get information about an individual VNF instance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
PUT individual vnfInstance
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Put ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
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}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${body}= Get File jsons/patchBodyRequest.json
Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body}
${outputResponse}= Output response
Loading full blame...