IMAGE="wfengine-activiti"
IMAGE_ACTIVITI_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
+#get current host IP addres
+SERVICE_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
+
# start wfengine-activiti
-##docker run -d --name ${IMAGE} -e OPENPALETTE_MSB_IP=${MSB_IAG_IP} -e OPENPALETTE_MSB_PORT=80 ${IMAGE_ACTIVITI_NAME}
-##WFENGINEACTIVITIR_IP=`get-instance-ip.sh ${IMAGE}`
+docker run -d --name vfc_wfengine_activiti -p 8804:8080 -e SERVICE_IP=$SERVICE_IP -e SERVICE_PORT=8804 -e OPENPALETTE_MSB_IP=${MSB_IAG_IP} -e OPENPALETTE_MSB_PORT=80 ${IMAGE_ACTIVITI_NAME}
+WFENGINE_ACTIVITI_IP=`get-instance-ip.sh vfc_wfengine_activiti`
# Wait for initialization
-##for i in {1..10}; do
-## curl -sS ${WFENGINEACTIVITIR_IP}:8080 && break
-## echo sleep $i
-## sleep $i
-##done
+for i in {1..10}; do
+ curl -sS ${WFENGINE_ACTIVITI_IP}:8080 && break
+ echo sleep $i
+ sleep $i
+done
+for i in {1..10}; do
+ curl -sS ${SERVICE_IP}:8804 && break
+ echo sleep $i
+ sleep $i
+done
+docker logs vfc_wfengine_activiti
-##IMAGE="wfengine-mgrservice"
-##IMAGE_MGRSERVICE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
+IMAGE="wfengine-mgrservice"
+IMAGE_MGRSERVICE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
# Start wfengine-mgrservice
-#docker run -d --name ${IMAGE} -e OPENPALETTE_MSB_IP=${MSB_IAG_IP} -e OPENPALETTE_MSB_PORT=80 ${IMAGE_MGRSERVICE_NAME}
+docker run -d --name vfc_wfengine_mgrservice -p 8805:10550 -e SERVICE_IP=$SERVICE_IP -e SERVICE_PORT=8805 -e OPENPALETTE_MSB_IP=${MSB_IAG_IP} -e OPENPALETTE_MSB_PORT=80 ${IMAGE_MGRSERVICE_NAME}
##docker run -d --name ${IMAGE} -e OPENPALETTE_MSB_IP=${WFENGINEACTIVITIR_IP} -e OPENPALETTE_MSB_PORT=8080 ${IMAGE_MGRSERVICE_NAME}
-##WFENGINEMGRSERVICE_IP=`get-instance-ip.sh ${IMAGE}`
-##for i in {1..10}; do
-## curl -sS ${WFENGINEMGRSERVICE_IP}:10550 && break
-## echo sleep $i
-## sleep $i
-##done
+WFENGINE_MGRSERVICE_IP=`get-instance-ip.sh vfc_wfengine_mgrservice`
+for i in {1..10}; do
+ curl -sS ${WFENGINE_MGRSERVICE_IP}:10550 && break
+ echo sleep $i
+ sleep $i
+done
+docker logs vfc_wfengine_mgrservice
# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-#ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_IP:${MSB_IAG_IP} -v MSB_PORT:80 -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v WFENGINEACTIVITIR_IP:${WFENGINEACTIVITIR_IP} -v WFENGINEACTIVITIR_PORT:8080 -v WFENGINEMGRSERVICE_IP:${WFENGINEMGRSERVICE_IP} -v WFENGINEMGRSERVICE_PORT:10550 -v SCRIPTS:${SCRIPTS}"
+ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP} -v MSB_IP:${MSB_IAG_IP} -v MSB_PORT:80 -v MSB_DISCOVERY_IP:${MSB_DISCOVERY_IP} -v ACTIVITI_IP:${WFENGINE_ACTIVITI_IP} -v ACTIVITI_PORT:8080 -v MGRSERVICE_IP:${WFENGINE_MGRSERVICE_IP} -v MGRSERVICE_PORT:10550 -v SCRIPTS:${SCRIPTS}"
##ROBOT_VARIABLES="-v MSB_IAG_IP:${WFENGINEACTIVITIR_IP} -v MSB_IP:${WFENGINEMGRSERVICE_IP} -v MSB_PORT:10550 -v MSB_DISCOVERY_IP:${WFENGINEACTIVITIR_IP} -v MSB_DISCOVERY_PORT:8080 -v WFENGINEACTIVITIR_IP:${WFENGINEACTIVITIR_IP} -v WFENGINEACTIVITIR_PORT:8080 -v WFENGINEMGRSERVICE_IP:${WFENGINEMGRSERVICE_IP} -v WFENGINEMGRSERVICE_PORT:10550 -v SCRIPTS:${SCRIPTS}"
\ No newline at end of file
-*** Settings ***
-Library Collections
-Library requests
-
-*** Test Cases ***
-Deploy BPMN File Test
- [Documentation] Check if the test bpmn file can be deployed in activiti engine
- Should Be Equal 200 200
-UnDeploy BPMN File Test
- [Documentation] Check if the test bpmn file can be undeployed in activiti engine
- Should Be Equal 404 404
-
-Exectue BPMN File Test
- [Documentation] Check if the test bpmn file can be exectued in activiti engine
- Should Be Equal 200 200
\ No newline at end of file
+*** Settings ***\r
+Resource ../../common.robot\r
+Library Collections\r
+Library json\r
+Library OperatingSystem\r
+Library RequestsLibrary\r
+Library HttpLibrary.HTTP\r
+\r
+*** Variables ***\r
+${MSB_IP} 127.0.0.1\r
+${MSB_PORT} 10550\r
+${ACTIVITI_IP} 127.0.0.1\r
+${ACTIVITI_PORT} 8804\r
+${MGRSERVICE_IP} 127.0.0.1\r
+${MGRSERVICE_PORT} 8805\r
+${processId} demo\r
+${deployid} 0\r
+${bmpfilepath} ${SCRIPTS}/nfvo-wfengine/demo.bpmn20.xml\r
+\r
+*** Test Cases ***\r
+Deploy BPMN File Test On Activiti\r
+ [Documentation] Check if the test bpmn file can be deployed in activiti engine\r
+ ${auth}= Create List kermit kermit\r
+ ${headers}= Create Dictionary Accept=application/json\r
+ Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} auth=${auth}\r
+ ${files}= evaluate {"file":open('${bmpfilepath}','rb')}\r
+ ${resp}= Post Request web_session /activiti-rest/service/repository/deployments files=${files}\r
+ Should Be Equal ${resp.status_code} ${201}\r
+ Log ${resp.json()}\r
+ ${deployedId}= Set Variable ${resp.json()["id"]}\r
+ Set Global Variable ${deployedId}\r
+\r
+Exectue BPMN File Testt On Activiti\r
+ [Documentation] Check if the test bpmn file can be exectued in activiti engine\r
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==\r
+ Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers}\r
+ ${body} Create Dictionary processDefinitionKey=${processId}\r
+ ${body} dumps ${body}\r
+ ${resp}= Post Request web_session /activiti-rest/service/runtime/process-instances ${body}\r
+ Should Be Equal ${resp.status_code} ${201}\r
+\r
+UnDeploy BPMN File Testt On Activiti\r
+ [Documentation] Check if the test bpmn file can be undeployed in activiti engine\r
+ log ${deployedId}\r
+ ${auth}= Create List kermit kermit\r
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json\r
+ Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} auth=${auth}\r
+ ${resp}= Delete Request web_session /activiti-rest/service/repository/deployments/${deployedId}?cascade=true\r
+ Should Be Equal ${resp.status_code} ${204}\r
+\r
+Deploy BPMN File Test On MgrService\r
+ [Documentation] Check if the test bpmn file can be deployed in Management Service\r
+ ${auth}= Create List kermit kermit\r
+ ${headers}= Create Dictionary Accept=application/json\r
+ Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} auth=${auth}\r
+ ${files}= evaluate {"file":open('${bmpfilepath}','rb')}\r
+ ${resp}= Post Request web_session api/workflow/v1/package files=${files}\r
+ Should Be Equal ${resp.status_code} ${200}\r
+ Log ${resp.json()}\r
+ ${deployedId}= Set Variable ${resp.json()["deployedId"]}\r
+ Set Global Variable ${deployedId}\r
+\r
+Exectue BPMN File Testt On MgrService\r
+ [Documentation] Check if the test bpmn file can be exectued in Management Service\r
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==\r
+ Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers}\r
+ ${body} Create Dictionary processDefinitionKey=${processId}\r
+ ${body} dumps ${body}\r
+ ${resp}= Post Request web_session api/workflow/v1/process/instance ${body}\r
+ Should Be Equal ${resp.status_code} ${200}\r
+ Log ${resp.json()}\r
+ Should Be Equal ${resp.json()["processDefinitionKey"]} ${processId}\r
+\r
+UnDeploy BPMN File Testt On MgrService\r
+ [Documentation] Check if the test bpmn file can be undeployed in Management Service\r
+ log ${deployedId}\r
+ ${auth}= Create List kermit kermit\r
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json\r
+ Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} auth=${auth}\r
+ ${resp}= Delete Request web_session /api/workflow/v1/package/${deployedId}\r
+ Should Be Equal ${resp.status_code} ${200}\r
+\r
+Deploy BPMN File Test On MSB\r
+ [Documentation] Check if the test bpmn file can be deployed in activiti engine\r
+ ${auth}= Create List kermit kermit\r
+ ${headers}= Create Dictionary Accept=application/json\r
+ Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} auth=${auth}\r
+ ${files}= evaluate {"file":open('${bmpfilepath}','rb')}\r
+ ${resp}= Post Request web_session api/workflow/v1/package files=${files}\r
+ Should Be Equal ${resp.status_code} ${200}\r
+ Log ${resp.json()}\r
+ ${deployedId}= Set Variable ${resp.json()["deployedId"]}\r
+ Set Global Variable ${deployedId}\r
+\r
+Exectue BPMN File Testt On MSB\r
+ [Documentation] Check if the test bpmn file can be exectued in MSB\r
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==\r
+ Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers}\r
+ ${body} Create Dictionary processDefinitionKey=${processId}\r
+ ${body} dumps ${body}\r
+ ${resp}= Post Request web_session api/workflow/v1/process/instance ${body}\r
+ Should Be Equal ${resp.status_code} ${200}\r
+ Log ${resp.json()}\r
+ Should Be Equal ${resp.json()["processDefinitionKey"]} ${processId}\r
+\r
+UnDeploy BPMN File Testt On MSB\r
+ [Documentation] Check if the test bpmn file can be undeployed in MSB\r
+ log ${deployedId}\r
+ ${auth}= Create List kermit kermit\r
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json\r
+ Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} auth=${auth}\r
+ ${resp}= Delete Request web_session /api/workflow/v1/package/${deployedId}\r
+ Should Be Equal ${resp.status_code} ${200}\r