2 Resource ../../common.robot
5 Library OperatingSystem
6 Library RequestsLibrary
7 Library HttpLibrary.HTTP
12 ${ACTIVITI_IP} 127.0.0.1
14 ${MGRSERVICE_IP} 127.0.0.1
15 ${MGRSERVICE_PORT} 8805
18 ${bmpfilepath} ${SCRIPTS}/nfvo-wfengine/demo.bpmn20.xml
21 Deploy BPMN File Test On Activiti
22 [Documentation] Check if the test bpmn file can be deployed in activiti engine
23 ${auth}= Create List kermit kermit
24 ${headers}= Create Dictionary Accept=application/json
25 Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} auth=${auth}
26 ${files}= evaluate {"file":open('${bmpfilepath}','rb')}
27 ${resp}= Post Request web_session /activiti-rest/service/repository/deployments files=${files}
28 Should Be Equal ${resp.status_code} ${201}
30 ${deployedId}= Set Variable ${resp.json()["id"]}
31 Set Global Variable ${deployedId}
33 Exectue BPMN File Testt On Activiti
34 [Documentation] Check if the test bpmn file can be exectued in activiti engine
35 ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==
36 Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers}
37 ${body} Create Dictionary processDefinitionKey=${processId}
39 ${resp}= Post Request web_session /activiti-rest/service/runtime/process-instances ${body}
40 Should Be Equal ${resp.status_code} ${201}
42 UnDeploy BPMN File Testt On Activiti
43 [Documentation] Check if the test bpmn file can be undeployed in activiti engine
45 ${auth}= Create List kermit kermit
46 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
47 Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} auth=${auth}
48 ${resp}= Delete Request web_session /activiti-rest/service/repository/deployments/${deployedId}?cascade=true
49 Should Be Equal ${resp.status_code} ${204}
51 Deploy BPMN File Test On MgrService
52 [Documentation] Check if the test bpmn file can be deployed in Management Service
53 ${auth}= Create List kermit kermit
54 ${headers}= Create Dictionary Accept=application/json
55 Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} auth=${auth}
56 ${files}= evaluate {"file":open('${bmpfilepath}','rb')}
57 ${resp}= Post Request web_session api/workflow/v1/package files=${files}
58 Should Be Equal ${resp.status_code} ${200}
60 ${deployedId}= Set Variable ${resp.json()["deployedId"]}
61 Set Global Variable ${deployedId}
63 Exectue BPMN File Testt On MgrService
64 [Documentation] Check if the test bpmn file can be exectued in Management Service
65 ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==
66 Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers}
67 ${body} Create Dictionary processDefinitionKey=${processId}
69 ${resp}= Post Request web_session api/workflow/v1/process/instance ${body}
70 Should Be Equal ${resp.status_code} ${200}
72 Should Be Equal ${resp.json()["processDefinitionKey"]} ${processId}
74 UnDeploy BPMN File Testt On MgrService
75 [Documentation] Check if the test bpmn file can be undeployed in Management Service
77 ${auth}= Create List kermit kermit
78 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
79 Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} auth=${auth}
80 ${resp}= Delete Request web_session /api/workflow/v1/package/${deployedId}
81 Should Be Equal ${resp.status_code} ${200}
83 # Deploy BPMN File Test On MSB
84 # [Documentation] Check if the test bpmn file can be deployed in activiti engine
85 # ${auth}= Create List kermit kermit
86 # ${headers}= Create Dictionary Accept=application/json
87 # Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} auth=${auth}
88 # ${files}= evaluate {"file":open('${bmpfilepath}','rb')}
89 # ${resp}= Post Request web_session api/workflow/v1/package files=${files}
90 # Should Be Equal ${resp.status_code} ${200}
92 # ${deployedId}= Set Variable ${resp.json()["deployedId"]}
93 # Set Global Variable ${deployedId}
95 # Exectue BPMN File Testt On MSB
96 # [Documentation] Check if the test bpmn file can be exectued in MSB
97 # ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==
98 # Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers}
99 # ${body} Create Dictionary processDefinitionKey=${processId}
100 # ${body} dumps ${body}
101 # ${resp}= Post Request web_session api/workflow/v1/process/instance ${body}
102 # Should Be Equal ${resp.status_code} ${200}
104 # Should Be Equal ${resp.json()["processDefinitionKey"]} ${processId}
106 # UnDeploy BPMN File Testt On MSB
107 # [Documentation] Check if the test bpmn file can be undeployed in MSB
109 # ${auth}= Create List kermit kermit
110 # ${headers} Create Dictionary Content-Type=application/json Accept=application/json
111 # Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} auth=${auth}
112 # ${resp}= Delete Request web_session /api/workflow/v1/package/${deployedId}
113 # Should Be Equal ${resp.status_code} ${200}