Skip to content
Snippets Groups Projects
Commit d6f1b4ed authored by mengxuan.zhao's avatar mengxuan.zhao
Browse files

OperateVNFWorkflow

parent 3a5608ff
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
Scale out a VNF Instance
Change VNF Flavour Operation
[Documentation] Test ID: 5.x.y.x
... Test title: Change VNF Flavour Operation
... Test objective: The objective is to test a change flavour operation of an existing VNF instance
......@@ -25,7 +25,7 @@ Scale out a VNF Instance
... Config ID: Config_prod_VNFM
... Applicability: change flavour operation is supported for the VNF (as capability in the VNFD)
... Post-Conditions: VNF instance still in INSTANTIATED state and the flavour is changed
Send VNF Scale Out Request
Send Change VNF Flavour Request
Check HTTP Response Status Code Is 202
Check HTTP Response Header Contains Location
Check Operation Occurrence Id
......
*** Settings ***
Resource environment/configuration.txt
Resource environment/variables.txt
Resource environment/scaleVariables.txt
Resource VnfLcmMntOperationKeywords.robot
Resource SubscriptionKeywords.robot
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}
... spec=SOL003-VNFLifecycleManagement-API.yaml
Library OperatingSystem
Library BuiltIn
Library Collections
Library JSONLibrary
Library Process
Suite Setup Initialize System
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
Operate a VNF Instance
[Documentation] Test ID: 5.x.y.x
... Test title: Operate a VNF Instance
... Test objective: The objective is to change the operational state of a VNF instance.
... Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c)
... Reference: section 5.3.3 - SOL003 v2.4.1
... Config ID: Config_prod_VNFM
... Applicability: change the operational state of a VNF instance is supported for the VNF (as capability in the VNFD)
... Post-Conditions: VNF instance still in INSTANTIATED state and the operational state is changed
Send Change VNF Operational State Request
Check HTTP Response Status Code Is 202
Check HTTP Response Header Contains Location
Check Operation Occurrence Id
Check Operation Notification For Operate STARTING
Create a new Grant - Sync - OPERATE
Check Operation Notification For Change Flavour PROCESSING
Check Operation Notification For Change Flavour COMPLETED
Check Postcondition VNF OPERATE
*** Keywords ***
Initialize System
Create Sessions
${body}= Get File json/operateVnFRequest.json
${changeVnfOperateRequest}= evaluate json.loads('''${body}''') json
${requestedState}= Get Value From Json ${changeVnfOperateRequest} $..changeStateTo
Precondition Checks
Check resource instantiated
${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE
Check Postcondition VNF
[Arguments] ${operation}
Check resource instantiated
${newState}= Get Vnf Operational State Info ${vnfInstanceId}
Should be Equal ${requestedState} ${newState}
Create a new Grant - Sync - OPERATE
Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} OPERATE
Check Operation Notification For Operate
[Arguments] ${status}
Check Operation Notification VnfLcmOperationOccurrenceNotification ${status}
\ No newline at end of file
......@@ -66,6 +66,12 @@ Get Vnf Flavour Info
${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}
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Should Contain ${response.headers} ${CONTENT_TYPE}
......@@ -112,6 +118,14 @@ Send Change VNF Flavour Request
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/changeVnfFlavourRequest.json
${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":"${AUTHORIZATION}"}
${body}= Get File json/operateVnFRequest.json
${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/operate ${body}
Create a new Grant - Synchronous mode
[Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment