diff --git a/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot b/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot index 9cfdaf58aca465264a8d1f773137109b6de871f8..f8319be9d44b80b508b90f4d381462546230fbbc 100644 --- a/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/CancelOperationTask.robot @@ -1,5 +1,6 @@ *** Settings *** -Resource environment/variables.txt +Resource environment/configuration.txt +Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml Library DependencyLibrary diff --git a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot index bb83d1ebb7075634a194e545886bc582afa79ad9..0922c40aeb7757c4ca186a7c569c60db69bc7e14 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeExternalVNFConnectivityTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot index 64cf8c63f069b74a3b03486bfdbce30738c3cdf1..093ab17c07b27f026f3789bd9e24a2e7ebf4eb61 100644 --- a/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot index 4a5e1583232ced0acd01e515914f10800f788d7b..ca2ca62077efd08fff20d6ecc8ca4298bca149c3 100644 --- a/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/FailOperationTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot b/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot index ddbbb3dc5e2137b281948966617d1f9eee6f455d..93e00e1b363fc4287fa0698d46d7b8af6dc4021c 100644 --- a/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot b/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot index b658ebc4788b49036136d5bbe9e6439f0dce0e11..87b94d674b49dad1fe5fd87e7aad6f12d628b65e 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualSubscription.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot index 20061b7a04c5650dc2b152f68fab6eadffcbf633..0c43fd511875e5f81553fec9b1fc9bdb9c2e3845 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVNFInstance.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt # Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} diff --git a/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot b/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot index 8ba4255f500bc3e9cb6c2c14d46357cee062b7e5..ac7dce4dceae0cc66aa291a8223f630173e79fb8 100644 --- a/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot +++ b/SOL003/VNFLifecycleManagement-API/IndividualVnfLcmOperationOccurence.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot index f640af660e24da5cdc0df42a4ffdc16ec2212529..a4ca1d3f2ac8c2cf08abddf21b704eabc0472115 100644 --- a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot index 637644b33ea3193311f0d6696d3541ed1966e595..e9f725a5701c0899b27d17b599db8b705fee4469 100644 --- a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot +++ b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot @@ -1,7 +1,10 @@ *** Setting *** Suite Setup Initialize System Suite Teardown Terminate All Processes kill=true +Resource environment/configuration.txt Resource environment/variables.txt +Resource VnfLcmMntOperationKeywords.robot +Resource SubscriptionKeywords.robot Library OperatingSystem Library MockServerLibrary Library Process @@ -12,13 +15,6 @@ Library JSONSchemaLibrary schemas/ Library JSONLibrary Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} -*** Variables *** -${headers} -${vnfLcmOpOccId} -${response} -&{notification_request} -&{notification_response} -${vnfInstanceId} *** Test Cases *** VNF Instantiation @@ -34,10 +30,10 @@ VNF Instantiation Check HTTP Response Status Code Is 202 Check HTTP Response Header Contains Location Check Operation Occurrence Id - Check Operation Notification STARTING - Check Operation Notification PROCESSING - Check Operation Notification COMPLETED - Check Postcondition + Check Operation Notification For Instantiation STARTING + Check Operation Notification For Instantiation PROCESSING + Check Operation Notification For Instantiation COMPLETED + Check Postcondition VNF Status INSTANTIATED *** Keywords *** Send VNF Instantiation Request @@ -47,85 +43,16 @@ Send VNF Instantiation Request Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} ${body}= Get File json/instantiateVnfRequest.json ${response}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/instantiate ${body} - -Check HTTP Response Status Code Is - [Arguments] ${expected_status} - Should Be Equal ${response.status_code} ${expected_status} - Log Status code validated - -Check HTTP Response Header Contains - [Arguments] ${CONTENT_TYPE} - Should Contain ${response.headers} ${CONTENT_TYPE} - Log Header is present - -Check Operation Occurrence Id - ${vnfLcmOpOccId}= Get Value From Json ${response.headers} $..Location - Should Not Be Empty ${vnfLcmOpOccId} - -Check HTTP Response Body Json Schema Is - [Arguments] ${schema} - ${json}= evaluate json.loads('''${response.body}''') json - Validate Json ${schema} ${json} - ${vnfInstanceId}= evaluate ${response.body.id} - Log Json Schema Validation OK - -Check VNF Status - [Arguments] ${current} ${expected} - Should Be Equal As Strings ${current} ${expected} - Log VNF Status in the correct status - -Check VNF Instance - [Arguments] ${vnfId} - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfId} - -Create Sessions - Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance - Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${callback_uri}:${callback_port} - -Configure Notification Handler - [Arguments] ${element} ${endpoint} - ${json}= Get File schemas/${element}.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle ${element} - &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${notification_request} ${notification_response} -Check Operation Notification +Check Operation Notification For Instantiation [Arguments] ${status} - Configure Notification Handler VnfLcmOperationOccurrenceNotification ${callback_endpoint} - Wait Until Keyword Succeeds 2 min 10 sec Verify Notification ${status} - Get ${vnfLcmOpOccId} - ${body}= Output response body - Should Be Equal ${body.operationState} ${status} - Clear Requests ${callback_endpoint} - -Verify Notification - [Arguments] ${status} - Verify Mock Expectation ${notification_request} - -Create VNF Resource - 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} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} Initialize System Create Sessions - Configure Notification Handler VnfIdentifierCreationNotification ${callback_endpoint} - Create VNF Resource - Check HTTP Response Status Code Is 201 - Check HTTP Response Header Contains Location - Check HTTP Response Header Contains Content-Type - Check HTTP Response Body Json Schema Is vnfInstance.schema.json -Check Postcondition +Check Postcondition VNF Status + [Arguments] ${status} Log Retrieve VNF Instance Check VNF Instance ${vnfInstanceId} Should Not Be Empty ${response} @@ -133,4 +60,4 @@ Check Postcondition Should Be Equal ${response.body.id} ${vnfInstanceId} Check HTTP Response Header Contains Content-Type Check HTTP Response Body Json Schema Is vnfInstance.schema.json - Check VNF Status ${response.body.instantiationState} INSTANTIATED \ No newline at end of file + Check VNF Status ${response.body.instantiationState} ${status} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/NotificationEndpoint.robot b/SOL003/VNFLifecycleManagement-API/NotificationEndpoint.robot index d5ec15223f21032319497f297d1d1ed2df7a08fd..5b4d0b0d7f815c15b812dc5ea2498b3ef47ccac5 100644 --- a/SOL003/VNFLifecycleManagement-API/NotificationEndpoint.robot +++ b/SOL003/VNFLifecycleManagement-API/NotificationEndpoint.robot @@ -1,6 +1,7 @@ *** Settings *** Suite Setup Create Sessions Suite Teardown Terminate All Processes kill=true +Resource environment/configuration.txt Resource environment/variables.txt Library MockServerLibrary Library Process diff --git a/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot index dca37b19ad252c4bb736fd98052f26e19647122f..eff48776bd104ba9bb82ac17789ecc9bc5a6c71d 100644 --- a/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/OperateVNFTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot b/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot index 357555567d1fef18ea7d1e8ca94f4c6d551f0584..52d510a7e638cf67fb79c1c95e5898cc3c140463 100644 --- a/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/RetryOperationTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot b/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot index be34ff1e7f83bc1baa6fa5c0ed3955f23f87faef..79777bfd5eb4fb17a385eb46a2618fca160138e4 100644 --- a/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot +++ b/SOL003/VNFLifecycleManagement-API/RollbackOperationTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot index e2d9b2abe56a5cd210a8415f1245ce8e77fff426..34d0721fb2ae1d9013c4b2991ad35e7512299f17 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskHighLevel.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskHighLevel.robot index 5dcaec9603df9a116d8dac0644f01f5454db6f7e..48c1c19a0269a5b5f2cc9ef766b1ba1caa67bc0e 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskHighLevel.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskHighLevel.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST http://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml Library OperatingSystem diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot index 9093c24bf9252075946ce5d596ef34a84f0a61ad..45293ded08c8afb9992015a89c2b08ca1f3802a2 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFTaskWorkflow.robot @@ -1,5 +1,6 @@ *** Settings *** -Resource environment/variables.txt +Resource environment/configuration.txt +Resource environment/variables.txt Resource environment/scaleVariables.txt Resource VnfLcmMntOperationKeywords.robot Resource SubscriptionKeywords.robot @@ -14,7 +15,7 @@ Suite Teardown Terminate All Processes kill=true *** Test Cases *** -Scale out a VnFInstance +Scale out a VNF Instance [Documentation] Test ID: 5.x.y.x ... Test title: Scale out VNF operation ... Test objective: The objective is to test a scale out of an existing VNF instance @@ -24,15 +25,15 @@ Scale out a VnFInstance ... Applicability: Scale operation is supported for the VNF (as capability in the VNFD) ... NFVO is not subscribed for ... Post-Conditions: VNF instance still in INSTANTIATED state and VNF was scaled - Send VNFScaleOut request ${vnfInstanceId} - Check Response Status Is 202 - Check Scale HTTP Response Header Contains Location - ${vnfLcmOpOccId}= Get VnfLcmOpOccId ${scaleOutResponse.headers} - Check Operation Notification STARTING ${notification_ep} ${vnfLcmOpOccId} + Send VNF Scale Out Request + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check Operation Occurrence Id + Check Operation Notification For Scale STARTING Create a new Grant - Sync - Scale - Check Operation Notification PROCESSING ${notification_ep} ${vnfLcmOpOccId} - Check Operation Notification COMPLETED ${notification_ep} ${vnfLcmOpOccId} - Postcondition Checks + Check Operation Notification For Scale PROCESSING + Check Operation Notification For Scale COMPLETED + Check Postcondition VNF SCALE_OUT *** Keywords *** @@ -44,10 +45,11 @@ Precondition Checks ${LccnSubscriptions}= Check subscriptions about one VNFInstance and operation type ${vnfInstanceId} VnfLcmOperationOccurrenceNotification operationType=SCALE ${scaleInfo}= Get Vnf Scale Info ${vnfInstanceId} -Postcondition Checks +Check Postcondition VNF + [Arguments] ${operation} Check resource instantiated ${newScaleInfo}= Get Vnf Scale Info ${vnfInstanceId} - Compare ScaleInfos SCALE_OUT ${scaleInfo} ${newScaleInfo} + Compare ScaleInfos ${operation} ${scaleInfo} ${newScaleInfo} Compare ScaleInfos [Arguments] ${type} ${old_scaleinfo} ${new_scaleinfo} @@ -64,12 +66,8 @@ Compare ScaleInfos Create a new Grant - Sync - Scale Create a new Grant - Synchronous mode ${vnfInstanceId} ${vnfLcmOpOccId} SCALE - -Check Response Status Is - [Arguments] ${expected_status} - Check Response Status ${expected_status} ${scaleOutResponse.status} - -Check Scale HTTP Response Header Contains - [Arguments] ${CONTENT_TYPE} - Check HTTP Response Header Contains ${scaleOutResponse.headers} ${CONTENT_TYPE} + +Check Operation Notification For Scale + [Arguments] ${status} + Check Operation Notification VnfLcmOperationOccurrenceNotification ${status} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot index ed76b660972738c80099d6c2fec20b86ff5c3e7c..b4eca6ed4f4abf641ba306e173aee24f56f1c012 100644 --- a/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot +++ b/SOL003/VNFLifecycleManagement-API/ScaleVNFToLevelTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot b/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot index 910f3d2dac6bd796268d0dd79d1058561923b042..3dce8f19ab17bc3906afc966c5575b1dd6435cb0 100644 --- a/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/SubscriptionKeywords.robot @@ -5,9 +5,12 @@ Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNF Library OperatingSystem Library BuiltIn Library Process +Library Collections Library JSONLibrary Library MockServerLibrary +*** Variables *** +${json} {} *** Keywords *** Check subscriptions about one VNFInstance and operation type @@ -20,30 +23,34 @@ Check subscriptions about one VNFInstance and operation type Array response body minItems=1 ${body} Output response body [Return] ${body} - + +Create Sessions + Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} + Configure Notification Handler - [Arguments] ${element} ${endpoint} - ${json}= Get File schemas/${element}.schema.json - ${BODY}= evaluate json.loads('''${json}''') json + [Arguments] ${endpoint} ${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_SCHEMA" body=${BODY} + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 Create Mock Expectation ${notification_request} ${notification_response} - [Return] &{notification_request} - -Check Operation Notification - [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} - Check operationState ${status} ${VnfLcmOccInstance} - Clear Requests ${endpoint} - -Create Sessions - Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${notification_port} alias=mockInstance - Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${NFVO_SCHEMA}://${NFVO_HOST}:${notification_port} #The API producer is set to NFVO according to SOL003-5.3.9 - +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} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} - \ No newline at end of file +Check Operation Notification + [Arguments] ${element} ${status} + 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} + Clear Requests ${notification_ep} + Clear Requests ${notification_ep_fwd} diff --git a/SOL003/VNFLifecycleManagement-API/Subscriptions.robot b/SOL003/VNFLifecycleManagement-API/Subscriptions.robot index 9d8ce914f1734a1d61d19ccb1086a99e40be5aa9..fb0385ca4a7374b3baf59275c3bd687206f45ec5 100644 --- a/SOL003/VNFLifecycleManagement-API/Subscriptions.robot +++ b/SOL003/VNFLifecycleManagement-API/Subscriptions.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot b/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot index 6ded762f0ee9a13f8275a7727303a509901811c9..adf8398f6224fe6b1240137925342eb9b962fcae 100644 --- a/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot +++ b/SOL003/VNFLifecycleManagement-API/TerminateVNFTask.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/VNFInstances.robot b/SOL003/VNFLifecycleManagement-API/VNFInstances.robot index dbd05a1c20d21536735421231916c83fa062c2ba..9670106cc3a8cff60a3ceee16f26abcc0755719e 100644 --- a/SOL003/VNFLifecycleManagement-API/VNFInstances.robot +++ b/SOL003/VNFLifecycleManagement-API/VNFInstances.robot @@ -1,5 +1,6 @@ *** Settings *** # Suite setup Expect spec SOL003-VNFLifecycleManagement-API.yaml +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/VnfInstancesWithChecks.robot b/SOL003/VNFLifecycleManagement-API/VnfInstancesWithChecks.robot index 17579cfcacc80ce339d91b7c7763bd69552387d4..d5183f7e028c26c17613a48e89cc6f66425d055a 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfInstancesWithChecks.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfInstancesWithChecks.robot @@ -1,4 +1,5 @@ *** Setting *** +Resource environment/configuration.txt Resource environment/variables.txt Library OperatingSystem Library BuiltIn diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot index d0b1a7e2d608b9532ab197e827d22424fae60c37..df94b4046350981ea0aa7398aa47deb9d6985bbe 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmMntOperationKeywords.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Resource environment/scaleVariables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} spec=SOL003-VNFLifecycleManagement-API.yaml @@ -21,6 +22,22 @@ Get Vnf Instance ${json}= evaluate json.loads('''${body}''') json [Return] ${json} +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal ${response.status_code} ${expected_status} + Log Status code validated + +Check Operation Occurrence Id + ${vnfLcmOpOccId}= Get Value From Json ${response.headers} $..Location + Should Not Be Empty ${vnfLcmOpOccId} + +Check HTTP Response Body Json Schema Is + [Arguments] ${schema} + ${json}= evaluate json.loads('''${response.body}''') json + Validate Json ${schema} ${json} + ${vnfInstanceId}= evaluate ${response.body.id} + Log Json Schema Validation OK + Check resource Instantiated Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} @@ -29,24 +46,30 @@ Check resource Instantiated Integer response status 200 String response body instantiationState INSTANTIATED +Check VNF Instance + [Arguments] ${vnfId} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${response}= Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfId} + +Check VNF Status + [Arguments] ${current} ${expected} + Should Be Equal As Strings ${current} ${expected} + Log VNF Status in the correct status + Get Vnf Scale Info [Arguments] ${vnfInstanceId} ${vnfInstance}= Get Vnf Instance ${vnfInstanceId} ${scaleInfo}= Get Value From Json ${vnfInstance} $..scaleStatus [Return] ${scaleInfo} -Check Response Status - [Arguments] ${expected_status} ${status} - Should Be Equal ${expected_status} ${status} - Log Status code validated - Check HTTP Response Header Contains - [Arguments] ${headers} ${CONTENT_TYPE} - Should Contain ${headers} ${CONTENT_TYPE} - Log Header is present + [Arguments] ${CONTENT_TYPE} + Should Contain ${response.headers} ${CONTENT_TYPE} + Log Header is present -Send VNFscaleOut Request - [Arguments] ${vnfInstanceId} +Send VNF Scale Out Request Log Trying to scale a vnf Instance Set Headers {"Accept":"${ACCEPT}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} @@ -56,26 +79,7 @@ Send VNFscaleOut Request ${aspectId}= Set Variable ${json.aspectId} ${scaleOutResponse}= Post ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/scale ${body} [Return] ${scaleOutResponse} - -Get VnfLcmOpOccId - [Arguments] ${headers} - ${json}= evaluate json.loads('''${headers}''') json - ${vnfLcmOpOccId}= Get Value From Json ${json} $..Location - Should Not Be Empty ${vnfLcmOpOccId} - [Return] ${vnfLcmOpOccId} - -Get VnfLcmOccInstance - [Arguments] ${vnfLcmOpOccId} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_lcm_op_occs/${vnfLcmOpOccId} - ${body}= Output response body - ${json}= evaluate json.loads('''${body}''') json - [Return] ${json} - -Check operationState - [Arguments] ${operationState} ${VnfLcmOccInstance} - ${currentState}= Get Value From Json ${VnfLcmOccInstance} $..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 diff --git a/SOL003/VNFLifecycleManagement-API/VnfLcmOperationOccurences.robot b/SOL003/VNFLifecycleManagement-API/VnfLcmOperationOccurences.robot index 30752f2ea8c6f4b09607b0d83d6b4affec8ecfde..9b4c72775f0e525bf3cc3e3506872031b14ac8b3 100644 --- a/SOL003/VNFLifecycleManagement-API/VnfLcmOperationOccurences.robot +++ b/SOL003/VNFLifecycleManagement-API/VnfLcmOperationOccurences.robot @@ -1,4 +1,5 @@ *** Settings *** +Resource environment/configuration.txt Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ... spec=SOL003-VNFLifecycleManagement-API.yaml diff --git a/SOL003/VNFLifecycleManagement-API/environment/configuration.txt b/SOL003/VNFLifecycleManagement-API/environment/configuration.txt new file mode 100644 index 0000000000000000000000000000000000000000..153f200df126b52bcdb1551afbe9a1eaeeffc0ad --- /dev/null +++ b/SOL003/VNFLifecycleManagement-API/environment/configuration.txt @@ -0,0 +1,31 @@ +*** Variables *** +${VNFM_HOST} localhost # Hostname of the VNFM +${VNFM_PORT} 8080 # Listening port of the VNFM +${NFVO_HOST} localhost # Hostname of the NFVO +${NFVO_PORT} 8081 # Listening port of the NFVO +${VNFM_SCHEMA} https +${NFVO_SCHEMA} https +${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== +${CONTENT_TYPE} application/json +${CONTENT_TYPE_PATCH} application/merge-patch+json +${ACCEPT} application/json +${apiRoot} / +${apiName} vnflcm +${apiVersion} v1 +${AUTH_USAGE} 1 +${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX +${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT +${ACCEPT_PLAIN} text/plain +${ACCEPT_ZIP} application/zip +${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c +${ARTIFACT_TYPE} application/octet-stream +${ARTIFACT_ID} artifactId +${WRONG_ACCEPT} application/json +${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d +${CancelMode} GRACEFUL +${NVFM_DUPLICATION} 0 +${SYNC_MODE} 0 +${sleep_interval} 20s +${callback_uri} http://localhost +${callback_port} 9091 +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/environment/scaleVariables.txt b/SOL003/VNFLifecycleManagement-API/environment/scaleVariables.txt index 3df4a927a3b19d534111ef121dfca0bee77f454b..d8e260b924a90f7744a738e16fdd2aa62a4939cf 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/scaleVariables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/scaleVariables.txt @@ -4,4 +4,3 @@ ${scaleInfo} ${element} ${aspectId} ${scaleOutResponse} -${vnfLcmOpOccId} \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index 63d8b18803f3e640b8900df5aebaec1803d0d244..29151922548dbc2e6b0524486c2e68211fc22ad5 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -1,49 +1,19 @@ *** Variables *** -${VNFM_HOST} localhost # Hostname of the VNFM -${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO -${VNFM_SCHEMA} https -${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== -${CONTENT_TYPE} application/json -${CONTENT_TYPE_PATCH} application/merge-patch+json -${ACCEPT} application/json -${apiRoot} / -${apiName} vnflcm -${apiVersion} v1 -${AUTH_USAGE} 1 -${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX ${vnfInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${vnfInstanceName} Test-VnfInstance ${vnfInstanceDescription} description vnf ${vnfInstanceDescription_Update} Updated description vnf -${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT -${ACCEPT_PLAIN} text/plain -${ACCEPT_ZIP} application/zip ${vnfPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c -${ARTIFACT_TYPE} application/octet-stream -${ARTIFACT_ID} artifactId -${WRONG_ACCEPT} application/json ${vnfLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d -${CancelMode} GRACEFUL -${NVFM_DUPLICATION} 0 ${sub_filter} filter ${sub_filter_invalid} filter_invalid ${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${notification_ep} /notification +${notification_ep_fwd} /notification/check ${notification_port} 9091 ${VnfLcmOperationOccurrenceNotification} {} ${VnfIdentifierCreationNotification} {} ${VnfIdentifierDeletionNotification} {} -${SYNC_MODE} 0 -${sleep_interval} 20s -${GRANT_POLLING_TOT} 2 -${GRANT_POLLING_INTERVAL} 5s -${SCALE_POLLING_TOT} 10 -${SCALE_POLLING_INTERVAL} 15s -${callback_uri} http://localhost -${callback_port} 9091 -${callback_endpoint} /endpoint -${callback_endpoint_error} /endpoint_404 -${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar \ No newline at end of file +${response} {} +${notification_request} [] +${notification_response} [] \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/jsons/lccnSubscriptionRequest.json b/SOL003/VNFLifecycleManagement-API/jsons/lccnSubscriptionRequest.json index e44916f8dd95ffe1fd61888add4ebf78653c43f1..5c8582a4967cadffdc02fdb3b21c0276f1681b05 100644 --- a/SOL003/VNFLifecycleManagement-API/jsons/lccnSubscriptionRequest.json +++ b/SOL003/VNFLifecycleManagement-API/jsons/lccnSubscriptionRequest.json @@ -6,5 +6,5 @@ ] } }, - "callbackUri": "http://127.0.0.1/subscribe" + "callbackUri": "http://localhost:9091/notification" } \ No newline at end of file