From 3a19f5f0642496fa892bdc7a80286fcc0e35d3c8 Mon Sep 17 00:00:00 2001 From: mxzhao Date: Tue, 18 Dec 2018 11:22:10 +0100 Subject: [PATCH] Update SOL003 VNF LCM --- .../ScaleVNFTaskWorkflow.robot | 13 +++++++------ .../SubscriptionKeywords.robot | 14 +++++++------- .../VnfLcmMntOperationKeywords.robot | 11 ++++++++++- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot index 4aad647a..329b7b86 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot @@ -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 diff --git a/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot b/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot index d2eb4d2a..f3c1cd60 100644 --- a/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot @@ -1,11 +1,11 @@ *** 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} diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index 90e3dbef..6341b080 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -1,9 +1,10 @@ *** 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 -- GitLab