Newer
Older
Resource environment/configuration.txt
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false
Library OperatingSystem
Library BuiltIn
Library JSONLibrary
Library Process
Library String
Create Sessions
Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance
Wait For Process handle=mockInstance timeout=5s on_timeout=continue
Create Mock Session ${callback_uri}:${callback_port}
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
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Should Be Equal As Strings ${response['status']} ${expected_status}
Log Status code validated
${vnfLcmOpOccId}= Get Value From Json ${response['headers']} $..Location
Should Not Be Empty ${vnfLcmOpOccId}
${vnfLcmOpOccId}= Get Value From Json ${response['headers']} $..Location
Check HTTP Response Body Json Schema Is
Log Json Schema Validation OK
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
Get Vnf Scale Info
[Arguments] ${vnfInstanceId}
${vnfInstance}= Get Vnf Instance ${vnfInstanceId}
${scaleInfo}= Get Value From Json ${vnfInstance} $..scaleStatus
[Return] ${scaleInfo}
Get Vnf Flavour Info
[Arguments] ${vnfInstanceId}
${vnfInstance}= Get Vnf Instance ${vnfInstanceId}
${flavourInfo}= Get Value From Json ${vnfInstance} $..flavourId
[Return] ${flavourInfo}
Get Vnf Operational State Info
[Arguments] ${vnfInstanceId}
${vnfInstance}= Get Vnf Instance ${vnfInstanceId}
${stateInfo}= Get Value From Json ${vnfInstance} $..vnfState
[Return] ${stateInfo}
Get Vnf Ext Link Id
[Arguments] ${vnfInstanceId}
${vnfInstance}= Get Vnf Instance ${vnfInstanceId}
[Return] ${vnfInstance.instantiatedVnfInfo.extVirtualLinkInfo.id}
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Log Header is present
Send VNF Scale Out Request
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_HEADER}":"${AUTHORIZATION_TOKEN}"}
${json}= evaluate json.loads('''${body}''') json
${aspectId}= Set Variable ${json.aspectId}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body}
Send VNF Scale To Level Request
[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_HEADER}":"${AUTHORIZATION_TOKEN}"}
${json}= evaluate json.loads('''${body}''') json
${aspectId}= Set Variable ${json.aspectId}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale_to_level ${body}
Log Create VNF instance by POST to ${apiRoot}/${apiName}/${apiVersion}/vnf_instances
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body}
log Delete an individual VNF instance
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${response}= Delete ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}
Send Change VNF Flavour Request
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_HEADER}":"${AUTHORIZATION_TOKEN}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_flavour ${body}
Send Change VNF Operational State Request
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_HEADER}":"${AUTHORIZATION_TOKEN}"}
${body}= Get File jsons/operateVnfRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body}
Send Heal VNF Request
Log Trying to heal a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Elian Kraja
committed
${body}= Get File jsons/healVnfRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal ${body}
Send Change Ext Connectivity Request
Log Trying to change the external connectivity of a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/change_ext_conn ${body}
Send Terminate VNF Request
Log Trying to terminate a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
Elian Kraja
committed
${body}= Get File jsons/terminateVnfRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/terminate ${body}
Send Info Modification Request
Log Trying to update information of a VNF instance.
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${response}= Patch ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId} ${body}
Send Retry Operation Request
Log Retry a VNF lifecycle operation if that operation has experienced a temporary failure
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/retry
Send Roll back Operation Request
Log Rollback a VNF lifecycle operation if that operation has experienced a temporary failure
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId}/rollback
Send Fail Operation Request
Loading full blame...