diff --git a/SOL003/VNFLifecycleManagement-API/CreateVNFWorkflow.robot b/SOL003/VNFLifecycleManagement-API/CreateVNFWorkflow.robot new file mode 100644 index 0000000000000000000000000000000000000000..a529ff4aac42ddbba9d5015fe02a04bf9ee2c3ac --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/CreateVNFWorkflow.robot @@ -0,0 +1,50 @@ +*** 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 *** +Create a VNF Instance + [Documentation] Test ID: 5.x.y.x + ... Test title: Create a VNF instance procedure + ... Test objective: The objective is to test the procedure for the creation of a VNF instance resource. + ... Pre-conditions: + ... Reference: section 5.3.1 - SOL003 v2.4.1; section + ... Config ID: Config_prod_VNFM + ... Applicability: + ... NFVO is not subscribed for + ... Post-Conditions: upon successful completion, the VNF instance resource has been created in "NOT_INSTANTIATED" state. + Send VNF create Request + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check Operation Notification For Create VnfIdentifierCreationNotification + Check Postcondition VNF CREATE + +*** Keywords *** + +Initialize System + Create Sessions + +Check Postcondition VNF + [Arguments] ${operation} + Check VNF Instance ${vnfInstanceId} + Check HTTP Response Status Code Is 200 + Check VNF Status ${response.body.instantiationState} NOT_INSTANTIATED + +Check Operation Notification For Create + [Arguments] ${element} + ${json}= Get File schemas/${element}.schema.json + Configure Notification Handler ${notification_ep} + \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFWorkflow.robot similarity index 98% rename from SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot rename to SOL003/VNFLifecycleManagement-API/ScaleVNFWorkflow.robot index baa9eccea6b68a029f4c5a1e124149123247a890..76aa99cca04052e79fe4193b3f9343f5cd49885f 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFWorkflow.robot @@ -4,7 +4,8 @@ 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 REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} +... spec=SOL003-VNFLifecycleManagement-API.yaml Library OperatingSystem Library BuiltIn Library Collections diff --git a/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot b/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot index 3dce8f19ab17bc3906afc966c5575b1dd6435cb0..6d30a3cf3fa2c17820fbd768c27bc2af5c0299c4 100644 --- a/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot @@ -9,9 +9,6 @@ Library Collections Library JSONLibrary Library MockServerLibrary -*** Variables *** -${json} {} - *** Keywords *** Check subscriptions about one VNFInstance and operation type [Arguments] ${vnfInstanceId} ${notificationType} ${operationType}="" ${operationState}="" @@ -30,8 +27,8 @@ Create Sessions Create Mock Session ${callback_uri}:${callback_port} Configure Notification Handler - [Arguments] ${endpoint} ${status} - set to dictionary ${json["operationState"]} dp=${status} + [Arguments] ${endpoint} ${status}="" + Run Keyword If ${status}!="" set to dictionary ${json["operationState"]} dp=${status} ${BODY}= evaluate json.dumps(${json}) json Log Creating mock request and response to handle ${element} &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} @@ -40,7 +37,6 @@ Configure Notification Handler Configure Notification Forward [Arguments] ${element} ${endpoint} ${endpoint_fwd} - ${json}= Get File schemas/${element}.schema.json ${BODY}= evaluate json.loads('''${json}''') json Log Creating mock HTTP forward to handle ${element} &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${BODY} @@ -48,7 +44,8 @@ Configure Notification Forward Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} Check Operation Notification - [Arguments] ${element} ${status} + [Arguments] ${element} ${status}="" + ${json}= Get File schemas/${element}.schema.json Configure Notification Forward ${element} ${notification_ep} ${notification_ep_fwd} Configure Notification Handler ${notification_ep_fwd} ${status} Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index fed95a398a310a1a765724afa7156382b7c6e28b..af56cbb2fe002294b614c9ce3e9297d9b91ad8fb 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -74,6 +74,14 @@ Send VNF Scale Out Request ${json}= evaluate json.loads('''${body}''') json ${aspectId}= Set Variable ${json.aspectId} ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} + +Send VNF Create Request + 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":"${AUTHORIZATION}"} + ${body}= Get File json/createVnfRequest.json + ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances ${body} Create a new Grant - Synchronous mode [Arguments] ${vnfInstanceId} ${vnfLcmOpOccId} ${operation} diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index 29151922548dbc2e6b0524486c2e68211fc22ad5..be88dca1740a47ee64bc9118986a49523499e2a5 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -16,4 +16,5 @@ ${VnfIdentifierCreationNotification} {} ${VnfIdentifierDeletionNotification} {} ${response} {} ${notification_request} [] -${notification_response} [] \ No newline at end of file +${notification_response} [] +${json} {} \ No newline at end of file