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

Create VNF instance workflow

parent 4e96f03a
No related branches found
No related tags found
No related merge requests found
*** 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
......@@ -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
......
......@@ -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}
......
......@@ -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}
......
......@@ -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
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