Update csit script for vfc-nfvo-wfengine 53/22453/3
authorZhaoxing <meng.zhaoxing1@zte.com.cn>
Tue, 7 Nov 2017 06:03:00 +0000 (14:03 +0800)
committerZhaoxing <meng.zhaoxing1@zte.com.cn>
Tue, 7 Nov 2017 07:49:17 +0000 (15:49 +0800)
Change-Id: I4a17b1a5f36515eaa40b5cdfdff3d6e4c5204fcb
Issue-id: VFC-139
Signed-off-by: Zhaoxing <meng.zhaoxing1@zte.com.cn>
test/csit/plans/vfc-nfvo-wfengine/sanity-check/setup.sh
test/csit/plans/vfc-nfvo-wfengine/sanity-check/teardown.sh
test/csit/plans/vfc-nfvo-wfengine/sanity-check/testplan.txt
test/csit/scripts/nfvo-wfengine/demo.bpmn20.xml [new file with mode: 0644]
test/csit/tests/vfc/nfvo-wfengine/workflow.robot

index d00a66c..5a57823 100644 (file)
@@ -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
index caa506e..384bc39 100644 (file)
@@ -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
index ff9f4d5..5f6910b 100644 (file)
@@ -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/.\r
+# Place the suites in run order.\r
+\r
 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 (file)
index 0000000..4f0c83a
--- /dev/null
@@ -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
index 82cdaed..07bfe69 100644 (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