summaryrefslogtreecommitdiffstats
path: root/test/csit
diff options
context:
space:
mode:
authorZhaoxing <meng.zhaoxing1@zte.com.cn>2017-11-07 14:03:00 +0800
committerZhaoxing <meng.zhaoxing1@zte.com.cn>2017-11-07 15:49:17 +0800
commitc6554b49c76321f2b24452f1290608f20e8f28b8 (patch)
tree1d21f835a91e76be932fcd96fdc2ef7d8120c7d5 /test/csit
parentcb152a8375caef65c5694efcfd53528d21c73a6b (diff)
Update csit script for vfc-nfvo-wfengine
Change-Id: I4a17b1a5f36515eaa40b5cdfdff3d6e4c5204fcb Issue-id: VFC-139 Signed-off-by: Zhaoxing <meng.zhaoxing1@zte.com.cn>
Diffstat (limited to 'test/csit')
-rw-r--r--test/csit/plans/vfc-nfvo-wfengine/sanity-check/setup.sh44
-rw-r--r--test/csit/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh4
-rw-r--r--test/csit/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt6
-rw-r--r--test/csit/scripts/nfvo-wfengine/demo.bpmn20.xml11
-rw-r--r--test/csit/tests/vfc/nfvo-wfengine/workflow.robot128
5 files changed, 156 insertions, 37 deletions
diff --git a/test/csit/plans/vfc-nfvo-wfengine/sanity-check/setup.sh b/test/csit/plans/vfc-nfvo-wfengine/sanity-check/setup.sh
index d00a66c52..5a578230b 100644
--- a/test/csit/plans/vfc-nfvo-wfengine/sanity-check/setup.sh
+++ b/test/csit/plans/vfc-nfvo-wfengine/sanity-check/setup.sh
@@ -48,30 +48,40 @@ DOCKER_REPOSITORY="nexus3.onap.org:10001"
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
diff --git a/test/csit/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh b/test/csit/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh
index caa506ecf..384bc3935 100644
--- a/test/csit/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh
+++ b/test/csit/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh
@@ -19,5 +19,5 @@
kill-instance.sh msb_internal_apigateway
kill-instance.sh msb_discovery
kill-instance.sh msb_consul
-##kill-instance.sh wfengine-mgrservice
-##kill-instance.sh wfengine-activiti
+kill-instance.sh vfc_wfengine_mgrservice
+kill-instance.sh vfc_wfengine_activiti
diff --git a/test/csit/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt b/test/csit/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt
index ff9f4d5d6..5f6910bdd 100644
--- a/test/csit/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt
+++ b/test/csit/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt
@@ -1,4 +1,4 @@
-# Test suites are relative paths under [integration.git]/test/csit/tests/.
-# Place the suites in run order.
-
+# Test suites are relative paths under [integration.git]/test/csit/tests/.
+# Place the suites in run order.
+
vfc/nfvo-wfengine/workflow.robot \ No newline at end of file
diff --git a/test/csit/scripts/nfvo-wfengine/demo.bpmn20.xml b/test/csit/scripts/nfvo-wfengine/demo.bpmn20.xml
new file mode 100644
index 000000000..4f0c83a6e
--- /dev/null
+++ b/test/csit/scripts/nfvo-wfengine/demo.bpmn20.xml
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
+ <process id="demo" name="demofirst" isExecutable="true">
+ <startEvent id="sid-6B31A927-8A0F-4A2F-BC58-A2E3D90327D2"/>
+ <userTask id="sid-FDC595C2-41CE-4DE8-86D4-562414F0A0F3"/>
+ <sequenceFlow id="sid-B7ABA5B4-FB87-486C-B7D7-CC0FE5A4CE31" sourceRef="sid-6B31A927-8A0F-4A2F-BC58-A2E3D90327D2" targetRef="sid-FDC595C2-41CE-4DE8-86D4-562414F0A0F3"/>
+ <endEvent id="sid-EEACC228-A53D-41E8-96A1-8F2E4BF38596"/>
+ <sequenceFlow id="sid-07534141-12BB-49F0-9288-137A4E0BC8D8" sourceRef="sid-FDC595C2-41CE-4DE8-86D4-562414F0A0F3" targetRef="sid-EEACC228-A53D-41E8-96A1-8F2E4BF38596"/>
+ </process>
+
+</definitions> \ No newline at end of file
diff --git a/test/csit/tests/vfc/nfvo-wfengine/workflow.robot b/test/csit/tests/vfc/nfvo-wfengine/workflow.robot
index 82cdaed7d..07bfe6979 100644
--- a/test/csit/tests/vfc/nfvo-wfengine/workflow.robot
+++ b/test/csit/tests/vfc/nfvo-wfengine/workflow.robot
@@ -1,15 +1,113 @@
-*** 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 ***
+Resource ../../common.robot
+Library Collections
+Library json
+Library OperatingSystem
+Library RequestsLibrary
+Library HttpLibrary.HTTP
+
+*** Variables ***
+${MSB_IP} 127.0.0.1
+${MSB_PORT} 10550
+${ACTIVITI_IP} 127.0.0.1
+${ACTIVITI_PORT} 8804
+${MGRSERVICE_IP} 127.0.0.1
+${MGRSERVICE_PORT} 8805
+${processId} demo
+${deployid} 0
+${bmpfilepath} ${SCRIPTS}/nfvo-wfengine/demo.bpmn20.xml
+
+*** Test Cases ***
+Deploy BPMN File Test On Activiti
+ [Documentation] Check if the test bpmn file can be deployed in activiti engine
+ ${auth}= Create List kermit kermit
+ ${headers}= Create Dictionary Accept=application/json
+ Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} auth=${auth}
+ ${files}= evaluate {"file":open('${bmpfilepath}','rb')}
+ ${resp}= Post Request web_session /activiti-rest/service/repository/deployments files=${files}
+ Should Be Equal ${resp.status_code} ${201}
+ Log ${resp.json()}
+ ${deployedId}= Set Variable ${resp.json()["id"]}
+ Set Global Variable ${deployedId}
+
+Exectue BPMN File Testt On Activiti
+ [Documentation] Check if the test bpmn file can be exectued in activiti engine
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==
+ Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers}
+ ${body} Create Dictionary processDefinitionKey=${processId}
+ ${body} dumps ${body}
+ ${resp}= Post Request web_session /activiti-rest/service/runtime/process-instances ${body}
+ Should Be Equal ${resp.status_code} ${201}
+
+UnDeploy BPMN File Testt On Activiti
+ [Documentation] Check if the test bpmn file can be undeployed in activiti engine
+ log ${deployedId}
+ ${auth}= Create List kermit kermit
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${ACTIVITI_IP}:${ACTIVITI_PORT} headers=${headers} auth=${auth}
+ ${resp}= Delete Request web_session /activiti-rest/service/repository/deployments/${deployedId}?cascade=true
+ Should Be Equal ${resp.status_code} ${204}
+
+Deploy BPMN File Test On MgrService
+ [Documentation] Check if the test bpmn file can be deployed in Management Service
+ ${auth}= Create List kermit kermit
+ ${headers}= Create Dictionary Accept=application/json
+ Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} auth=${auth}
+ ${files}= evaluate {"file":open('${bmpfilepath}','rb')}
+ ${resp}= Post Request web_session api/workflow/v1/package files=${files}
+ Should Be Equal ${resp.status_code} ${200}
+ Log ${resp.json()}
+ ${deployedId}= Set Variable ${resp.json()["deployedId"]}
+ Set Global Variable ${deployedId}
+
+Exectue BPMN File Testt On MgrService
+ [Documentation] Check if the test bpmn file can be exectued in Management Service
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==
+ Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers}
+ ${body} Create Dictionary processDefinitionKey=${processId}
+ ${body} dumps ${body}
+ ${resp}= Post Request web_session api/workflow/v1/process/instance ${body}
+ Should Be Equal ${resp.status_code} ${200}
+ Log ${resp.json()}
+ Should Be Equal ${resp.json()["processDefinitionKey"]} ${processId}
+
+UnDeploy BPMN File Testt On MgrService
+ [Documentation] Check if the test bpmn file can be undeployed in Management Service
+ log ${deployedId}
+ ${auth}= Create List kermit kermit
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${MGRSERVICE_IP}:${MGRSERVICE_PORT} headers=${headers} auth=${auth}
+ ${resp}= Delete Request web_session /api/workflow/v1/package/${deployedId}
+ Should Be Equal ${resp.status_code} ${200}
+
+Deploy BPMN File Test On MSB
+ [Documentation] Check if the test bpmn file can be deployed in activiti engine
+ ${auth}= Create List kermit kermit
+ ${headers}= Create Dictionary Accept=application/json
+ Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} auth=${auth}
+ ${files}= evaluate {"file":open('${bmpfilepath}','rb')}
+ ${resp}= Post Request web_session api/workflow/v1/package files=${files}
+ Should Be Equal ${resp.status_code} ${200}
+ Log ${resp.json()}
+ ${deployedId}= Set Variable ${resp.json()["deployedId"]}
+ Set Global Variable ${deployedId}
+
+Exectue BPMN File Testt On MSB
+ [Documentation] Check if the test bpmn file can be exectued in MSB
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic a2VybWl0Omtlcm1pdA==
+ Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers}
+ ${body} Create Dictionary processDefinitionKey=${processId}
+ ${body} dumps ${body}
+ ${resp}= Post Request web_session api/workflow/v1/process/instance ${body}
+ Should Be Equal ${resp.status_code} ${200}
+ Log ${resp.json()}
+ Should Be Equal ${resp.json()["processDefinitionKey"]} ${processId}
+
+UnDeploy BPMN File Testt On MSB
+ [Documentation] Check if the test bpmn file can be undeployed in MSB
+ log ${deployedId}
+ ${auth}= Create List kermit kermit
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${MSB_IP}:${MSB_PORT} headers=${headers} auth=${auth}
+ ${resp}= Delete Request web_session /api/workflow/v1/package/${deployedId}
+ Should Be Equal ${resp.status_code} ${200}