diff options
author | 2021-05-22 22:45:54 +0530 | |
---|---|---|
committer | 2021-05-31 20:09:45 +0530 | |
commit | 7d9a8742d4bf5f0d98003b6836b09f6ff17b0331 (patch) | |
tree | b10904d6faaca5e9264bc3874d6b61273bb47651 /tests/so/sanity-check/macroflow.robot | |
parent | 14e7ac625932814feaa8fb5f0545f327a5766a2d (diff) |
Added CSIT for Macroflow with HELM
Issue-ID: SO-3585
Signed-off-by: MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Change-Id: I3eb3ec1005f19fc109e28b1e709bdc0d32f1180a
Diffstat (limited to 'tests/so/sanity-check/macroflow.robot')
-rw-r--r-- | tests/so/sanity-check/macroflow.robot | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/tests/so/sanity-check/macroflow.robot b/tests/so/sanity-check/macroflow.robot index cd3a5b55..53424d04 100644 --- a/tests/so/sanity-check/macroflow.robot +++ b/tests/so/sanity-check/macroflow.robot @@ -5,16 +5,16 @@ Library OperatingSystem Library json *** Variables *** -${SLEEP_INTERVAL_SEC}= 60 +${SLEEP_INTERVAL_SEC}= 30 +${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 48 # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry. *** Test Cases *** Distribute Service Template Create Session sdc_controller_session http://${REPO_IP}:8085 ${data}= Get Binary File ${CURDIR}${/}data${/}serviceBasicVfCnfnotification.json &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test-zip/unzipped/ Content-Type=application/json Accept=application/json - ${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers} + ${resp}= POST On Session sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers} Log To Console Received status code: ${resp.status_code} - Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result Should Be Equal As Strings '${resp.status_code}' '200' @@ -22,8 +22,24 @@ Macroflow Create Session api_handler_session http://${REPO_IP}:8080 ${data}= Get Binary File ${CURDIR}${/}data${/}macroflow.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} + ${service_instantiation_request}= POST On Session api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances data=${data} headers=${headers} Log To Console Received status code: ${service_instantiation_request.status_code} - Run Keyword If '${service_instantiation_request.status_code}' == '202' log to console \nexecuted with expected result - Should Be Equal As Strings '${service_instantiation_request.status_code}' '202' - SLEEP ${SLEEP_INTERVAL_SEC}s + ${service_instantiation_json_response}= Evaluate json.loads(r"""${service_instantiation_request.content}""", strict=False) json + ${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId] + ${actual_request_state}= Set Variable "" + + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${orchestration_status_request}= Get On Session 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(r"""${orchestration_status_request.content}""", strict=False) json + ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] + Log To Console Received actual repsonse status:${actual_request_state} + 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 + END + + 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' |