Commit 3a19f5f0 authored by mengxuan.zhao's avatar mengxuan.zhao
Browse files

Update SOL003 VNF LCM

parent 4990bc95
......@@ -2,7 +2,7 @@
Resource environment/variables.txt
Resource VnfLcmMntOperationKeywords.robot
Resource SubscriptionKeywords.robot
Library REST http://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml
Library OperatingSystem
Library BuiltIn
Library Collections
......@@ -31,10 +31,10 @@ Scale out a VnFInstance
Check Response Status 202 ${response.status}
Check HTTP Response Header Contains Location ${response.headers}
${vnfLcmOpOccId}= Get VnfLcmOpOccId ${response.headers}
Check Operation Notification STARTING ${notification_ep}
Create a new Grant - Synchronous mode
Check Operation Notification PROCESSING ${notification_ep}
Check Operation Notification COMPLETED ${notification_ep}
Check Operation Notification STARTING ${notification_ep} ${vnfLcmOpOccId}
Create a new Grant - Sync - Scale
Check Operation Notification PROCESSING ${notification_ep} ${vnfLcmOpOccId}
Check Operation Notification COMPLETED ${notification_ep} ${vnfLcmOpOccId}
Postcondition Checks
*** Keywords ***
......@@ -62,5 +62,6 @@ Compare ScaleInfos
Run Keyword If ${type}==SCALE_OUT Should Be True ${old_level_value}<${new_level_value}
... ELSE Should Be True ${old_level_value}<${new_level_value}
Create a new Grant - Sync - Scale
Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} SCALE
\ No newline at end of file
*** Settings ***
Resource environment/variables.txt
Resource VnfLcmMntOperationKeywords.robot
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml
Library OperatingSystem
Library BuiltIn
Resource environment/variables.txt
Resource VnfLcmMntOperationKeywords.robot
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml
Library OperatingSystem
Library BuiltIn
Library Process
Library JSONLibrary
Library JSONLibrary
Library MockServerLibrary
......@@ -32,7 +32,7 @@ Configure Notification Handler
[Return] &{notification_request}
Check Operation Notification
[Arguments] ${status} ${endpoint}
[Arguments] ${status} ${endpoint} ${vnfLcmOpOccId}
${req}= Configure Notification Handler VnfLcmOperationOccurrenceNotification ${endpoint}
Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${req}
${VnfLcmOccInstance}= Get VnfLcmOccInstance ${vnfLcmOpOccId}
......
*** Settings ***
Resource environment/variables.txt
Library REST http://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml
Library OperatingSystem
Library BuiltIn
Library JSONLibrary
Library Collections
Library JSONSchemaLibrary schemas/
......@@ -73,12 +74,16 @@ Check operationState
Should Be Equal ${currentState} ${operationState}
Create a new Grant - Synchronous mode
[Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation}
Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants
Pass Execution If ${SYNC_MODE} == 0 The Granting process is asynchronous mode. Skipping the test
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File json/grantRequest.json
${json_body}= evaluate json.loads('''${body}''') json
Set To Dictionary ${json_body} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} operation=${operation}
${body}= evaluate json.dumps(${json_body}) json
Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body}
Integer response status 201
Log Status code validated
......@@ -92,12 +97,16 @@ Create a new Grant - Synchronous mode
Log Validation OK
Create a new Grant - Asynchronous mode
[Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation}
Log Request a new Grant for a VNF LCM operation by POST to ${apiRoot}/${apiName}/${apiVersion}/grants
Pass Execution If ${SYNC_MODE} == 1 The Granting process is synchronous mode. Skipping the test
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File json/grantRequest.json
${json_body}= evaluate json.loads('''${body}''') json
Set To Dictionary ${json_body} vnfInstanceId=${vnfInstanceId} vnfLcmOpOccId=${vnfLcmOpOccId} operation=${operation}
${body}= evaluate json.dumps(${json_body}) json
Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body}
Output response
Integer response status 202
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment