From: Zhaoxing Date: Tue, 7 Nov 2017 06:03:00 +0000 (+0800) Subject: Update csit script for vfc-nfvo-wfengine X-Git-Tag: 1.0.0-Amsterdam~79 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=c6554b49c76321f2b24452f1290608f20e8f28b8;p=integration.git Update csit script for vfc-nfvo-wfengine Change-Id: I4a17b1a5f36515eaa40b5cdfdff3d6e4c5204fcb Issue-id: VFC-139 Signed-off-by: Zhaoxing --- 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 @@ + + + + + + + + + + + \ 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}