diff options
author | eHanan <eoin.hanan@est.tech> | 2019-08-13 15:44:16 +0000 |
---|---|---|
committer | Eoin Hanan <eoin.hanan@est.tech> | 2019-08-13 15:46:12 +0000 |
commit | 75c1171a3a0d0fbfe8a71b8b9fe308356f45c35d (patch) | |
tree | 3f86f42541cea44aac60e1c1231536287df32550 /tests/so/etsi | |
parent | dd4052610fab6da25d3c47c4ea3265daa2139df4 (diff) |
Create basic Test case to invoke ETSI flow
Change-Id: I6786ec0a97789965825f4d0b390a44c5a3aa5d64
Issue-ID: SO-2144
Signed-off-by: eHanan <eoin.hanan@est.tech>
Diffstat (limited to 'tests/so/etsi')
-rw-r--r-- | tests/so/etsi/data/serviceInstantiationRequest.json | 33 | ||||
-rw-r--r-- | tests/so/etsi/etsi_tests.robot | 32 |
2 files changed, 59 insertions, 6 deletions
diff --git a/tests/so/etsi/data/serviceInstantiationRequest.json b/tests/so/etsi/data/serviceInstantiationRequest.json new file mode 100644 index 00000000..054a2ffe --- /dev/null +++ b/tests/so/etsi/data/serviceInstantiationRequest.json @@ -0,0 +1,33 @@ +{ + "requestDetails": { + "requestInfo": { + "instanceName": "CsitEtsiInstance", + "source": "VID", + "suppressRollback": false, + "requestorId": "demo" + }, + "modelInfo": { + "modelType": "service", + "modelInvariantId": "0ddc448d-5513-44bc-8b02-5759d84600d5", + "modelVersionId": "28d4acf3-4791-4998-8d06-1cdf6d1767a9", + "modelName": "manualDistributionTestService", + "modelVersion": "1.0" + }, + "requestParameters": { + "userParams": [], + "testApi": "GR_API", + "subscriptionServiceType": "vCPE", + "aLaCarte": true + }, + "subscriberInfo": { + "globalSubscriberId": "DemoCustomer" + }, + "project": { + "projectName": "etsiCsitProject" + }, + "owningEntity": { + "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a", + "owningEntityName": "OE-Demonstration" + } + } +} diff --git a/tests/so/etsi/etsi_tests.robot b/tests/so/etsi/etsi_tests.robot index e3d0a950..a3b658c9 100644 --- a/tests/so/etsi/etsi_tests.robot +++ b/tests/so/etsi/etsi_tests.robot @@ -5,16 +5,36 @@ Library OperatingSystem Library json *** Variables *** -${MESSAGE} Hello, world! -*** Test Cases *** +*** Test Cases *** Distribute Service Template - Create Session refrepo http://${REPO_IP}:8085 + Create Session sdc_controller_session http://${REPO_IP}:8085 ${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate.json &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test-zip/unzipped Content-Type=application/json Accept=application/json - log to console \nAbout to POST ${REPO_IP} - ${resp}= Post Request refrepo /test/treatNotification/v1 data=${data} headers=${headers} - log to console \nAFRTE POST + ${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers} Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result +Invoke Service Instantiation + Create Session api_handler_session http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}serviceInstantiationRequest.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances data=${data} headers=${headers} + Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result + log to console ${service_instantiation_request.content} + ${service_instantiation_json_responce}= Evaluate json.loads("""${service_instantiation_request.content}""") json + + ${actual_request_state}= SET VARIABLE "" + + : FOR ${INDEX} IN RANGE 48 + \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${service_instantiation_json_responce}[requestReferences][requestId] + \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result + \ log to console ${orchestration_status_request.content} + \ ${orchestration_json_responce}= Evaluate json.loads("""${orchestration_status_request.content}""") json + \ ${actual_request_state}= SET VARIABLE ${orchestration_json_responce}[request][requestStatus][requestState] + \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop + \ log to console Received actual repsonse status:${actual_request_state} + \ log to console Will try again after 5 seconds + \ SLEEP 5s + + Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result |