aboutsummaryrefslogtreecommitdiffstats
path: root/tests/so
diff options
context:
space:
mode:
authoreHanan <eoin.hanan@est.tech>2019-09-25 15:24:32 +0100
committereHanan <eoin.hanan@est.tech>2019-09-26 08:54:50 +0100
commit6bd3f6cc4d34a6b97c23fe7c8deccf527128a19b (patch)
tree56dba3e1cabc83d27d10e54af964952bdbd15c1c /tests/so
parenta1f84a15cf98925a334062bfd912c9097c1b5be5 (diff)
Create service delete test
Change-Id: I01e2539df365d2c40ec9bab8c3f3f30553d61d04 Issue-ID: SO-2342 Signed-off-by: eHanan <eoin.hanan@est.tech>
Diffstat (limited to 'tests/so')
-rw-r--r--tests/so/etsi/data/serviceDeleteRequest.json19
-rw-r--r--tests/so/etsi/etsi_tests.robot28
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/so/etsi/data/serviceDeleteRequest.json b/tests/so/etsi/data/serviceDeleteRequest.json
new file mode 100644
index 00000000..257b0673
--- /dev/null
+++ b/tests/so/etsi/data/serviceDeleteRequest.json
@@ -0,0 +1,19 @@
+{
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "service",
+ "modelInvariantId": "0ddc448d-5513-44bc-8b02-5759d84600d5",
+ "modelVersionId": "28d4acf3-4791-4998-8d06-1cdf6d1767a9",
+ "modelName": "manualDistributionTestService",
+ "modelVersion": "1.0"
+ },
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": "demo"
+ },
+ "requestParameters": {
+ "testApi": "GR_API",
+ "aLaCarte": true
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/so/etsi/etsi_tests.robot b/tests/so/etsi/etsi_tests.robot
index 89843b6a..d7ba80c8 100644
--- a/tests/so/etsi/etsi_tests.robot
+++ b/tests/so/etsi/etsi_tests.robot
@@ -106,3 +106,31 @@ Delete VNF Instance
Log To Console final repsonse status received: ${actual_request_state}
Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result
Should Be Equal As Strings '${actual_request_state}' 'COMPLETE'
+
+
+Delete Service Instance
+ Run Keyword If "${service_instance_Id}" != "${EMPTY}" Log to Console VNF Instance ID :${service_instance_Id} received
+ ... ELSE Fail Log to Console Invalid Service Instance ID :${service_instance_Id} recieved
+
+ Create Session api_handler_session http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}serviceDeleteRequest.json
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
+ ${service_delete_request}= Delete Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id} data=${data} headers=${headers}
+ ${service_delete_json_response}= Evaluate json.loads("""${service_delete_request.content}""") json
+ Log to Console ${service_delete_json_response}
+ ${request_ID}= Set Variable ${service_delete_json_response}[requestReferences][requestId]
+ ${actual_request_state}= Set Variable ""
+
+ : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+ \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
+ \ 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_response}= Evaluate json.loads("""${orchestration_status_request.content}""") json
+ \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState]
+ \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
+ \ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds
+ \ SLEEP ${SLEEP_INTERVAL_SEC}s
+
+ Log To Console final repsonse status received: ${actual_request_state}
+ Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${actual_request_state}' 'COMPLETE'