blob: a3b658c92bca4211fb8f5c7fb2284eef137d4328 [file] [log] [blame]
rope2521537edf2019-07-25 16:04:10 +00001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7*** Variables ***
eHanan75c11712019-08-13 15:44:16 +00008
rope2521537edf2019-07-25 16:04:10 +00009
10*** Test Cases ***
rope2521537edf2019-07-25 16:04:10 +000011Distribute Service Template
eHanan75c11712019-08-13 15:44:16 +000012 Create Session sdc_controller_session http://${REPO_IP}:8085
rope2521537edf2019-07-25 16:04:10 +000013 ${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate.json
14 &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test-zip/unzipped Content-Type=application/json Accept=application/json
eHanan75c11712019-08-13 15:44:16 +000015 ${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers}
rope2521537edf2019-07-25 16:04:10 +000016 Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result
17
eHanan75c11712019-08-13 15:44:16 +000018Invoke Service Instantiation
19 Create Session api_handler_session http://${REPO_IP}:8080
20 ${data}= Get Binary File ${CURDIR}${/}data${/}serviceInstantiationRequest.json
21 &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
22 ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances data=${data} headers=${headers}
23 Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result
24 log to console ${service_instantiation_request.content}
25 ${service_instantiation_json_responce}= Evaluate json.loads("""${service_instantiation_request.content}""") json
26
27 ${actual_request_state}= SET VARIABLE ""
28
29 : FOR ${INDEX} IN RANGE 48
30 \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${service_instantiation_json_responce}[requestReferences][requestId]
31 \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result
32 \ log to console ${orchestration_status_request.content}
33 \ ${orchestration_json_responce}= Evaluate json.loads("""${orchestration_status_request.content}""") json
34 \ ${actual_request_state}= SET VARIABLE ${orchestration_json_responce}[request][requestStatus][requestState]
35 \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop
36 \ log to console Received actual repsonse status:${actual_request_state}
37 \ log to console Will try again after 5 seconds
38 \ SLEEP 5s
39
40 Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result