From af8aad211786393c3505c7649cc18c88195b8f45 Mon Sep 17 00:00:00 2001 From: ehautot Date: Fri, 23 Feb 2018 12:36:37 +0100 Subject: Fix clamp integration APIs due to code change Change-Id: I6537143329a8bd16c7648a07d5a00fb76d0d8130 Signed-off-by: ehautot Issue-ID: CLAMP-100 --- .../clamp/clone_clamp_and_change_dockercompose.sh | 9 ++ .../kill_and_remove_clamp_and_db_containers.sh | 1 + test/csit/scripts/clamp/start_clamp_containers.sh | 18 +++ .../tests/clamp/APIs/01__Create_CL_Holmes.robot | 46 ++++++++ test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot | 46 ++++++++ test/csit/tests/clamp/APIs/01__TCA.robot | 53 --------- test/csit/tests/clamp/APIs/02__Holmes.robot | 53 --------- test/csit/tests/clamp/APIs/03__VariousApis.robot | 12 +- .../tests/clamp/APIs/data/createClHolmes1.json | 10 ++ .../tests/clamp/APIs/data/createClHolmes2.json | 8 ++ test/csit/tests/clamp/APIs/data/createClTCA1.json | 8 ++ test/csit/tests/clamp/APIs/data/createClTCA2.json | 8 ++ .../tests/clamp/APIs/data/createHolmesModel1.json | 8 -- .../clamp/APIs/data/createHolmesTemplate1.json | 7 -- .../clamp/APIs/data/createHolmesTemplate2.json | 7 -- .../tests/clamp/APIs/data/createTCAModel1.json | 8 -- .../tests/clamp/APIs/data/createTCAModel2.json | 8 -- .../tests/clamp/APIs/data/createTCATemplate1.json | 7 -- .../tests/clamp/APIs/data/createTCATemplate2.json | 7 -- .../tests/clamp/UIs/01__Create_Holmes_model.robot | 62 ++++++++++ .../tests/clamp/UIs/01__Create_TCA_template.robot | 81 ------------- .../tests/clamp/UIs/02__Create_TCA_model.robot | 26 +++-- .../clamp/UIs/03__Create_Holmes_template.robot | 66 ----------- .../tests/clamp/UIs/04__Create_Holmes_model.robot | 50 -------- .../clamp/UIs/data/TCA_template_properties.yml | 127 +++++++++++++-------- 25 files changed, 322 insertions(+), 414 deletions(-) create mode 100644 test/csit/tests/clamp/APIs/01__Create_CL_Holmes.robot create mode 100644 test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot delete mode 100644 test/csit/tests/clamp/APIs/01__TCA.robot delete mode 100644 test/csit/tests/clamp/APIs/02__Holmes.robot create mode 100644 test/csit/tests/clamp/APIs/data/createClHolmes1.json create mode 100644 test/csit/tests/clamp/APIs/data/createClHolmes2.json create mode 100644 test/csit/tests/clamp/APIs/data/createClTCA1.json create mode 100644 test/csit/tests/clamp/APIs/data/createClTCA2.json delete mode 100644 test/csit/tests/clamp/APIs/data/createHolmesModel1.json delete mode 100644 test/csit/tests/clamp/APIs/data/createHolmesTemplate1.json delete mode 100644 test/csit/tests/clamp/APIs/data/createHolmesTemplate2.json delete mode 100644 test/csit/tests/clamp/APIs/data/createTCAModel1.json delete mode 100644 test/csit/tests/clamp/APIs/data/createTCAModel2.json delete mode 100644 test/csit/tests/clamp/APIs/data/createTCATemplate1.json delete mode 100644 test/csit/tests/clamp/APIs/data/createTCATemplate2.json create mode 100644 test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot delete mode 100644 test/csit/tests/clamp/UIs/01__Create_TCA_template.robot delete mode 100644 test/csit/tests/clamp/UIs/03__Create_Holmes_template.robot delete mode 100644 test/csit/tests/clamp/UIs/04__Create_Holmes_model.robot (limited to 'test') diff --git a/test/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh b/test/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh index f3b080ea1..14619b9f3 100755 --- a/test/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh +++ b/test/csit/scripts/clamp/clone_clamp_and_change_dockercompose.sh @@ -33,3 +33,12 @@ cd clamp/extra/docker/clamp/ # Pull the Clamp docker image from nexus instead of local image by default in the docker-compose.yml sed -i '/image: onap\/clamp/c\ image: nexus3.onap.org:10001\/onap\/clamp' docker-compose.yml +# Change config to take localhost:8085 for SDC and Policy simulator +sed -i 's/classpath:\/clds\/clds-reference.properties/file:.\/config\/clds-reference-sdc_proxy.properties/g' clamp.env +sed -i 's/classpath:\/clds\/clds-policy-config.properties/file:.\/config\/clds-policy-config-sdc_proxy.properties/g' clamp.env + +# Add the sql to create template so it is played by docker-compose later +cp ../../../src/test/resources/sql/four_templates_only.sql ../../sql/bulkload/ +echo 'mysql -uroot -p$MYSQL_ROOT_PASSWORD -f < four_templates_only.sql' >> ../../sql/load-sql-files-tests-automation.sh + + diff --git a/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh b/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh index c51464300..d59d19407 100755 --- a/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh +++ b/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_containers.sh @@ -21,5 +21,6 @@ echo "This is ${WORKSPACE}/test/csit/scripts/clamp/kill_and_remove_clamp_and_db_ kill-instance.sh clamp_clamp_1 kill-instance.sh clamp_db_1 +kill-instance.sh clamp_sdc_proxy_1 # $WORKSPACE/archives/clamp-clone deleted with archives folder when tests starts so we keep it at the end for debugging diff --git a/test/csit/scripts/clamp/start_clamp_containers.sh b/test/csit/scripts/clamp/start_clamp_containers.sh index 02abe264c..e49a591dd 100755 --- a/test/csit/scripts/clamp/start_clamp_containers.sh +++ b/test/csit/scripts/clamp/start_clamp_containers.sh @@ -48,3 +48,21 @@ if [ "$TIME" -ge "$TIME_OUT" ]; then echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for tests... fi +# To avoid some problem because templates not yet read +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + response=$(curl --write-out '%{http_code}' --silent --output /dev/null -u admin:5f4dcc3b5aa765d61d8327deb882cf99 http://localhost:8080/restservices/clds/v1/cldsTempate/template-names); echo $response + + if [ "$response" == "200" ]; then + echo Templates well available + break; + fi + + echo Sleep: $INTERVAL seconds before testing if templates available. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) +done + +if [ "$TIME" -ge "$TIME_OUT" ]; then + echo TIME OUT: Templates not available in $TIME_OUT seconds... Could cause problems for tests... +fi diff --git a/test/csit/tests/clamp/APIs/01__Create_CL_Holmes.robot b/test/csit/tests/clamp/APIs/01__Create_CL_Holmes.robot new file mode 100644 index 000000000..86e792313 --- /dev/null +++ b/test/csit/tests/clamp/APIs/01__Create_CL_Holmes.robot @@ -0,0 +1,46 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json + + +*** Test Cases *** +Get Requests health check ok + CreateSession clamp http://localhost:8080 + ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify test template found + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/cldsTempate/template-names + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain Match ${resp} *templateHolmes1* + Should Contain Match ${resp} *templateHolmes2* + Should Not Contain Match ${resp} *templateHolmes99* + +Put Requests to add Close Loop ClHolmes1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createClHolmes1.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/ClHolmes1 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Put Requests to add Close Loop ClHolmes2 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createClHolmes2.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/ClHolmes2 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify CL1 found + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain Match ${resp} *ClHolmes1* + Should Contain Match ${resp} *ClHolmes2* + Should Not Contain Match ${resp} *ClHolmes99* diff --git a/test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot b/test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot new file mode 100644 index 000000000..4805ced60 --- /dev/null +++ b/test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot @@ -0,0 +1,46 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json + + +*** Test Cases *** +Get Requests health check ok + CreateSession clamp http://localhost:8080 + ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify test template found + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/cldsTempate/template-names + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain Match ${resp} *templateTCA1* + Should Contain Match ${resp} *templateTCA2* + Should Not Contain Match ${resp} *templateTCA99* + +Put Requests to add Close Loop ClHolmes1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createClTCA1.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/ClTCA1 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Put Requests to add Close Loop ClHolmes2 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createClTCA2.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/ClTCA2 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify CL1 found + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain Match ${resp} *ClTCA1* + Should Contain Match ${resp} *ClTCA2* + Should Not Contain Match ${resp} *ClTCA99* diff --git a/test/csit/tests/clamp/APIs/01__TCA.robot b/test/csit/tests/clamp/APIs/01__TCA.robot deleted file mode 100644 index c96d9bcab..000000000 --- a/test/csit/tests/clamp/APIs/01__TCA.robot +++ /dev/null @@ -1,53 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - - -*** Test Cases *** -Get Requests health check ok - CreateSession clamp http://localhost:8080 - ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck - Should Be Equal As Strings ${resp.status_code} 200 - -Put Requests to add TCA template1 with yaml properties - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createTCATemplate1.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/TCATemplate1 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Put Requests to add TCA template2 with yaml properties - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createTCATemplate2.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/TCATemplate2 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Get Requests verify TCA template1 and template2 found - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/cldsTempate/template-names - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain Match ${resp} *TCATemplate1* - Should Contain Match ${resp} *TCATemplate2* - Should Not Contain Match ${resp} *TCATemplate99* - -Put Requests to add Close Loop TCA Model1 - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createTCAModel1.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/clds/model/TCAModel1 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Get Requests verify TCA Model1 found - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain Match ${resp} *TCAModel1* - Should Not Contain Match ${resp} *TCAModel99* diff --git a/test/csit/tests/clamp/APIs/02__Holmes.robot b/test/csit/tests/clamp/APIs/02__Holmes.robot deleted file mode 100644 index 055b99af9..000000000 --- a/test/csit/tests/clamp/APIs/02__Holmes.robot +++ /dev/null @@ -1,53 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - - -*** Test Cases *** -Get Requests health check ok - CreateSession clamp http://localhost:8080 - ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck - Should Be Equal As Strings ${resp.status_code} 200 - -Put Requests to add Holmes template1 without properties - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createHolmesTemplate1.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/HolmesTemplate1 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Put Requests to add Holmes template2 without properties - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createHolmesTemplate2.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/HolmesTemplate2 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Get Requests verify Holmes template1 and template2 found - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/cldsTempate/template-names - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain Match ${resp} *HolmesTemplate1* - Should Contain Match ${resp} *HolmesTemplate2* - Should Not Contain Match ${resp} *HolmesTemplate99* - -Put Requests to add Close Loop Holmes Model1 - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createHolmesModel1.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/clds/model/HolmesModel1 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Get Requests verify Holmes Model1 found - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain Match ${resp} *HolmesModel1* - Should Not Contain Match ${resp} *HolmesModel99* diff --git a/test/csit/tests/clamp/APIs/03__VariousApis.robot b/test/csit/tests/clamp/APIs/03__VariousApis.robot index 85782a28e..47441e894 100644 --- a/test/csit/tests/clamp/APIs/03__VariousApis.robot +++ b/test/csit/tests/clamp/APIs/03__VariousApis.robot @@ -23,7 +23,7 @@ Get Clamp Info Get model bpmn by name ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/clds/model/bpmn/HolmesModel1 + ${resp}= Get Request clamp /restservices/clds/v1/clds/model/bpmn/ClHolmes1 Should Contain Match ${resp} *StartEvent_* Should Contain Match ${resp} *VesCollector_* Should Contain Match ${resp} *Holmes_* @@ -33,7 +33,7 @@ Get model bpmn by name Get model by name ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/clds/model/HolmesModel1 + ${resp}= Get Request clamp /restservices/clds/v1/clds/model/ClHolmes1 Dictionary Should Contain Key ${resp.json()} templateName Dictionary Should Contain Key ${resp.json()} bpmnText Dictionary Should Contain Key ${resp.json()} imageText @@ -42,5 +42,9 @@ Get model names ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 Create Session clamp http://localhost:8080 auth=${auth} ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names - Should Contain Match ${resp} *HolmesModel1* - Should Not Contain Match ${resp} *model99* \ No newline at end of file + Should Contain Match ${resp} *ClHolmes1* + Should Contain Match ${resp} *ClHolmes2* + Should Contain Match ${resp} *ClTCA1* + Should Contain Match ${resp} *ClTCA2* + Should Not Contain Match ${resp} *ClHolmes99* + Should Not Contain Match ${resp} *ClTCA99* diff --git a/test/csit/tests/clamp/APIs/data/createClHolmes1.json b/test/csit/tests/clamp/APIs/data/createClHolmes1.json new file mode 100644 index 000000000..5c89efdb8 --- /dev/null +++ b/test/csit/tests/clamp/APIs/data/createClHolmes1.json @@ -0,0 +1,10 @@ +{ + "name":"ClHolmes1", + "controlNamePrefix":"ClosedLoop-", + "bpmnText":"", + "propText":"{\"global\":[{\"name\":\"service\",\"value\":[\"4cc5b45a-1f63-4194-8100-cd8e14248c92\"]},{\"name\":\"vf\",\"value\":[\"07e266fc-49ab-4cd7-8378-ca4676f1b9ec\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]},{\"name\":\"location\",\"value\":[\"DC1\",\"DC2\"]}],\"Holmes_1gxp0mm\":[{\"name\":\"correlationalLogic\",\"value\":\"correlational logic1\"},{\"name\":\"configPolicyName\",\"value\":\"Config Policy name1\"}],\"Policy_136qatf\":{\"Policy1\":[{\"name\":\"pname\",\"value\":\"Policy1\"},{\"name\":\"pid\",\"value\":\"0\"},{\"name\":\"timeout\",\"value\":\"345\"},{\"policyConfigurations\":[[{\"name\":\"recipe\",\"value\":[\"restart\"]},{\"name\":\"maxRetries\",\"value\":[\"3\"]},{\"name\":\"retryTimeLimit\",\"value\":[\"180\"]},{\"name\":\"_id\",\"value\":[\"QxHBjiW\"]},{\"name\":\"parentPolicy\",\"value\":[\"\"]},{\"name\":\"targetResourceId\",\"value\":[\"\"]}]]}]}}", + "imageText":"VESVesCollectorHHolmesPolicy", + "templateName":"templateHolmes1", + "typeId":null, + "deploymentId":null +} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createClHolmes2.json b/test/csit/tests/clamp/APIs/data/createClHolmes2.json new file mode 100644 index 000000000..dc5720809 --- /dev/null +++ b/test/csit/tests/clamp/APIs/data/createClHolmes2.json @@ -0,0 +1,8 @@ +{ + "name":"ClHolmes2", + "controlNamePrefix":"ClosedLoop-", + "bpmnText":"", + "propText":"{\"Holmes_0bsv00m\":[{\"name\":\"correlationalLogic\",\"value\":\"correlation logic2\"},{\"name\":\"configPolicyName\",\"value\":\"Config Policy Name2\"}],\"global\":[{\"name\":\"service\",\"value\":[\"c95b0e7c-c1f0-4287-9928-7964c5377a46\"]},{\"name\":\"vf\",\"value\":[\"48504e0e-f3d3-411d-a52b-eda1b8fec073\"]},{\"name\":\"actionSet\",\"value\":[\"enbRecipe\"]},{\"name\":\"location\",\"value\":[\"DC2\",\"DC3\"]}],\"Policy_114xo8j\":{\"Policy2\":[{\"name\":\"pname\",\"value\":\"Policy2\"},{\"name\":\"pid\",\"value\":\"0\"},{\"name\":\"timeout\",\"value\":\"345\"},{\"policyConfigurations\":[[{\"name\":\"recipe\",\"value\":[\"reset\"]},{\"name\":\"maxRetries\",\"value\":[\"5\"]},{\"name\":\"retryTimeLimit\",\"value\":[\"360\"]},{\"name\":\"_id\",\"value\":[\"Uw5gftt\"]},{\"name\":\"parentPolicy\",\"value\":[\"\"]},{\"name\":\"targetResourceId\",\"value\":[\"\"]}]]}]}}", + "imageText":"HHolmesVESVesCollectorPolicy", + "templateName":"templateHolmes2" +} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createClTCA1.json b/test/csit/tests/clamp/APIs/data/createClTCA1.json new file mode 100644 index 000000000..d72a82ee3 --- /dev/null +++ b/test/csit/tests/clamp/APIs/data/createClTCA1.json @@ -0,0 +1,8 @@ +{ + "name":"ClTCA1", + "controlNamePrefix":"ClosedLoop-", + "bpmnText":"", + "propText":"{\"global\":[{\"name\":\"service\",\"value\":[\"4cc5b45a-1f63-4194-8100-cd8e14248c92\"]},{\"name\":\"vf\",\"value\":[\"023a3f0d-1161-45ff-b4cf-8918a8ccf3ad\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]},{\"name\":\"location\",\"value\":[\"DC1\",\"DC2\"]}],\"TCA_1d13unw\":{\"TCA1\":[{\"name\":\"tname\",\"value\":\"TCA1\"},{\"name\":\"tuuid\",\"value\":\"ce57408b-93ba-td02-1622-165abd6c5ff5\"},{\"name\":\"tcaPol\",\"value\":\"Policy3\"},{\"name\":\"eventName\",\"value\":\"vLoadBalancer\"},{\"name\":\"controlLoopSchemaType\",\"value\":\"VNF\"},{\"name\":\"tcaPolId\",\"value\":\"0\"},{\"serviceConfigurations\":[[\"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta\",\"GREATER\",\"5\",\"ONSET\"]]}]},\"Policy_12lup3h\":{\"Policy3\":[{\"name\":\"pname\",\"value\":\"Policy3\"},{\"name\":\"pid\",\"value\":\"0\"},{\"name\":\"timeout\",\"value\":\"345\"},{\"policyConfigurations\":[[{\"name\":\"recipe\",\"value\":[\"restart\"]},{\"name\":\"maxRetries\",\"value\":[\"4\"]},{\"name\":\"retryTimeLimit\",\"value\":[\"200\"]},{\"name\":\"_id\",\"value\":[\"42adC3e\"]},{\"name\":\"parentPolicy\",\"value\":[\"\"]},{\"name\":\"targetResourceId\",\"value\":[\"\"]}]]}]}}", + "imageText":"VESVesCollectorTCAPolicy", + "templateName":"templateTCA1" +} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createClTCA2.json b/test/csit/tests/clamp/APIs/data/createClTCA2.json new file mode 100644 index 000000000..0e47d21b6 --- /dev/null +++ b/test/csit/tests/clamp/APIs/data/createClTCA2.json @@ -0,0 +1,8 @@ +{ + "name":"ClTCA2", + "controlNamePrefix":"ClosedLoop-", + "bpmnText":"", + "propText":"{\"Policy_1r0guma\":{\"Policy4\":[{\"name\":\"pname\",\"value\":\"Policy4\"},{\"name\":\"pid\",\"value\":\"0\"},{\"name\":\"timeout\",\"value\":\"345\"},{\"policyConfigurations\":[[{\"name\":\"recipe\",\"value\":[\"migrate\"]},{\"name\":\"maxRetries\",\"value\":[\"10\"]},{\"name\":\"retryTimeLimit\",\"value\":[\"300\"]},{\"name\":\"_id\",\"value\":[\"m5YLmst\"]},{\"name\":\"parentPolicy\",\"value\":[\"\"]},{\"name\":\"targetResourceId\",\"value\":[\"\"]}]]}]},\"global\":[{\"name\":\"service\",\"value\":[\"4cc5b45a-1f63-4194-8100-cd8e14248c92\"]},{\"name\":\"vf\",\"value\":[\"023a3f0d-1161-45ff-b4cf-8918a8ccf3ad\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]},{\"name\":\"location\",\"value\":[\"DC1\",\"DC2\",\"DC3\"]}],\"TCA_09syovq\":{\"TCA2\":[{\"name\":\"tname\",\"value\":\"TCA2\"},{\"name\":\"tuuid\",\"value\":\"3794f32d-8d95-tf61-444b-0b374cc173b2\"},{\"name\":\"tcaPol\",\"value\":\"Policy4\"},{\"name\":\"eventName\",\"value\":\"vLoadBalancer\"},{\"name\":\"controlLoopSchemaType\",\"value\":\"VM\"},{\"name\":\"tcaPolId\",\"value\":\"0\"},{\"serviceConfigurations\":[[\"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta\",\"GREATER\",\"15\",\"ONSET\",\"undefined\"]]}]}}", + "imageText":"VESVesCollectorTCAPolicy", + "templateName":"templateTCA2" +} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createHolmesModel1.json b/test/csit/tests/clamp/APIs/data/createHolmesModel1.json deleted file mode 100644 index 893d1b33f..000000000 --- a/test/csit/tests/clamp/APIs/data/createHolmesModel1.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "HolmesModel1", - "controlNamePrefix": "ClosedLoop-", - "bpmnText": " SequenceFlow_0qhfouo SequenceFlow_0qhfouo SequenceFlow_0cnyoua SequenceFlow_0cnyoua SequenceFlow_11v8o1t SequenceFlow_11v8o1t SequenceFlow_1akbqn5 SequenceFlow_1akbqn5 ", - "propText": "{}", - "imageText": "", - "templateName": "HolmesTemplate1" -} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createHolmesTemplate1.json b/test/csit/tests/clamp/APIs/data/createHolmesTemplate1.json deleted file mode 100644 index 27627ed65..000000000 --- a/test/csit/tests/clamp/APIs/data/createHolmesTemplate1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "HolmesTemplate1", - "controlNamePrefix": "ClosedLoop-", - "bpmnText": " SequenceFlow_0qhfouo SequenceFlow_0qhfouo SequenceFlow_0cnyoua SequenceFlow_0cnyoua SequenceFlow_11v8o1t SequenceFlow_11v8o1t SequenceFlow_1akbqn5 SequenceFlow_1akbqn5 ", - "propText": "{\"global\":[{\"name\":\"vf\",\"value\":[\"\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]},{\"name\":\"location\",\"value\":[\"ALPRGAED\",\"LSLEILAA\",\"MDTWNJC1\"]}]}", - "imageText": "VESVesCollectorHHolmesPolicy" -} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createHolmesTemplate2.json b/test/csit/tests/clamp/APIs/data/createHolmesTemplate2.json deleted file mode 100644 index dab6e2e93..000000000 --- a/test/csit/tests/clamp/APIs/data/createHolmesTemplate2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "HolmesTemplate2", - "controlNamePrefix": "ClosedLoop-", - "bpmnText": " SequenceFlow_0qhfouo SequenceFlow_0qhfouo SequenceFlow_0cnyoua SequenceFlow_0cnyoua SequenceFlow_11v8o1t SequenceFlow_11v8o1t SequenceFlow_1akbqn5 SequenceFlow_1akbqn5 ", - "propText": "{\"global\":[{\"name\":\"vf\",\"value\":[\"\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]},{\"name\":\"location\",\"value\":[\"ALPRGAED\",\"LSLEILAA\",\"MDTWNJC1\"]}]}", - "imageText": "VESVesCollectorHHolmesPolicy" -} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createTCAModel1.json b/test/csit/tests/clamp/APIs/data/createTCAModel1.json deleted file mode 100644 index 2d5962408..000000000 --- a/test/csit/tests/clamp/APIs/data/createTCAModel1.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "TCAModel1", - "controlNamePrefix": "ClosedLoop-", - "bpmnText": " SequenceFlow_092lmnt SequenceFlow_092lmnt SequenceFlow_109bxgj SequenceFlow_109bxgj SequenceFlow_05zltzk SequenceFlow_05zltzk SequenceFlow_1n94h2v SequenceFlow_1n94h2v ", - "propText": "{\"global\":[{\"name\":\"vf\",\"value\":[\"\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]},{\"name\":\"location\",\"value\":[\"ALPRGAED\",\"LSLEILAA\",\"MDTWNJC1\"]}]}", - "imageText": "", - "templateName": "TCATemplate1" -} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createTCAModel2.json b/test/csit/tests/clamp/APIs/data/createTCAModel2.json deleted file mode 100644 index f7168ddc4..000000000 --- a/test/csit/tests/clamp/APIs/data/createTCAModel2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "TCAModel2", - "controlNamePrefix": "ClosedLoop-", - "bpmnText": " SequenceFlow_092lmnt SequenceFlow_092lmnt SequenceFlow_109bxgj SequenceFlow_109bxgj SequenceFlow_05zltzk SequenceFlow_05zltzk SequenceFlow_1n94h2v SequenceFlow_1n94h2v ", - "propText": "{\"global\":[{\"name\":\"vf\",\"value\":[\"\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]},{\"name\":\"location\",\"value\":[\"ALPRGAED\",\"LSLEILAA\",\"MDTWNJC1\"]}]}", - "imageText": "", - "templateName": "TCATemplate2" -} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createTCATemplate1.json b/test/csit/tests/clamp/APIs/data/createTCATemplate1.json deleted file mode 100644 index 0c5987edb..000000000 --- a/test/csit/tests/clamp/APIs/data/createTCATemplate1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "TCATemplate1", - "controlNamePrefix": "ClosedLoop-", - "bpmnText": " SequenceFlow_092lmnt SequenceFlow_092lmnt SequenceFlow_109bxgj SequenceFlow_109bxgj SequenceFlow_05zltzk SequenceFlow_05zltzk SequenceFlow_1n94h2v SequenceFlow_1n94h2v ", - "propText": "{\"global\":[{\"name\":\"service\",\"value\":[\"tosca_definitions_version: cloudify_dsl_1_2\\r\\n\\r\\nimports:\\r\\n- http://www.getcloudify.org/spec/cloudify/3.3.1/types.yaml\\r\\n- http://127.0.0.1/1607_prod/type_files/cdap_app.yaml\\r\\n\\r\\nnode_templates:\\r\\n MTCA:\\r\\n type: dcae.nodes.cdap_app\\r\\n properties:\\r\\n service_name: \\\"cdap-mtca-central\\\"\\r\\n deployment_JSON: |-\\r\\n {\\r\\n \\\"clusterService\\\": {\\\"$ref\\\": \\\"/services/vm-cdap-cluster-central/instances/rdm2c\\\"},\\r\\n \\\"namespace\\\": \\\"MTCA\\\",\\r\\n \\\"appNames\\\": [ \\\"cdap-mtca\\\" ],\\r\\n \\\"flowNames\\\": [ \\\"cdap-mtca.TCAVESCollectorFlow\\\" ],\\r\\n \\\"workerNames\\\": [\\\"cdap-mtca.TCADMaaPMRSubscriberWorker\\\", \\\"cdap-mtca.TCADMaaPMRPublisherWorker\\\"],\\r\\n \\\"serviceNames\\\" : [],\\r\\n \\\"apps\\\": {\\r\\n \\\"cdap-mtca\\\": {\\r\\n \\\"jarFile\\\": \\\"/opt/app/cdap-apps/dcae-analytics-mtca-1.0.0.jar\\\",\\r\\n \\\"artifactName\\\": \\\"dcae-analytics-mtca\\\",\\r\\n \\\"version\\\": \\\"1.0.0\\\",\\r\\n \\\"appConfigFileContent\\\": \\\"{config:{ \\\\\\\"appName\\\\\\\":\\\\\\\"cdap-mtca\\\\\\\", \\\\\\\"appDescription\\\\\\\":\\\\\\\"DCAE Analytics Threshold Crossing Alert Application\\\\\\\", \\\\\\\"tcaSubscriberOutputStreamName\\\\\\\":\\\\\\\"TCASubscriberOutputStream\\\\\\\", \\\\\\\"thresholdCalculatorFlowletInstances\\\\\\\":2, \\\\\\\"tcaVESMessageStatusTableName\\\\\\\":\\\\\\\"TCAVESMessageStatusTable\\\\\\\", \\\\\\\"tcaVESMessageStatusTableTTLSeconds\\\\\\\":864000, \\\\\\\"tcaVESAlertsTableName\\\\\\\":\\\\\\\"TCAVESAlertsTable\\\\\\\", \\\\\\\"tcaVESAlertsTableTTLSeconds\\\\\\\":1728000 }}\\\"\\r\\n }\\r\\n },\\r\\n \\r\\n \\\"configuration\\\": {\\r\\n \\\"$class\\\": \\\"com.att.ecomp.dcae.clamp.common.MThresholdCrossingConfiguration\\\",\\r\\n \\\"subscriberContentType\\\": \\\"\\\",\\r\\n \\\"subscriberConsumerId\\\": \\\"c12\\\",\\r\\n \\\"subscriberConsumerGroup\\\": \\\"OpenDCAE-c12\\\",\\r\\n \\\"subscriberTimeoutMS\\\": \\\"-1\\\",\\r\\n \\\"subscriberMessageLimit\\\": \\\"-1\\\",\\r\\n \\\"subscriberPollingInterval\\\": \\\"20000\\\",\\r\\n \\\"publisherContentType\\\": \\\"application/json\\\",\\r\\n \\\"publisherMaxBatchSize\\\": \\\"10\\\",\\r\\n \\\"publisherMaxRecoveryQueueSize\\\": \\\"100000\\\",\\r\\n \\\"publisherPollingInterval\\\": \\\"20000\\\",\\r\\n \\\"publisherAlertWindowingTime\\\": \\\"86400\\\",\\r\\n \\\"policyName\\\": \\\"policy.dcae.configuration\\\",\\r\\n \\\"policyScope\\\": \\\"pnf=eNodeB;type=configuration\\\",\\r\\n \\\"policyVersion\\\": \\\"1.0.0\\\",\\r\\n \\\"domain\\\" : \\\"measurementsForVfScaling\\\",\\r\\n \\r\\n \\\"signatures\\\" : {\\r\\n \\t }\\r\\n\\r\\n }\\r\\n }\\r\\n\"]}]}", - "imageText":"VESVesCollectorTCAPolicy" -} \ No newline at end of file diff --git a/test/csit/tests/clamp/APIs/data/createTCATemplate2.json b/test/csit/tests/clamp/APIs/data/createTCATemplate2.json deleted file mode 100644 index 4488f4e59..000000000 --- a/test/csit/tests/clamp/APIs/data/createTCATemplate2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "TCATemplate2", - "controlNamePrefix": "ClosedLoop-", - "bpmnText": " SequenceFlow_092lmnt SequenceFlow_092lmnt SequenceFlow_109bxgj SequenceFlow_109bxgj SequenceFlow_05zltzk SequenceFlow_05zltzk SequenceFlow_1n94h2v SequenceFlow_1n94h2v ", - "propText": "{\"global\":[{\"name\":\"service\",\"value\":[\"tosca_definitions_version: cloudify_dsl_1_2\\r\\n\\r\\nimports:\\r\\n- http://www.getcloudify.org/spec/cloudify/3.3.1/types.yaml\\r\\n- http://127.0.0.1/1607_prod/type_files/cdap_app.yaml\\r\\n\\r\\nnode_templates:\\r\\n MTCA:\\r\\n type: dcae.nodes.cdap_app\\r\\n properties:\\r\\n service_name: \\\"cdap-mtca-central\\\"\\r\\n deployment_JSON: |-\\r\\n {\\r\\n \\\"clusterService\\\": {\\\"$ref\\\": \\\"/services/vm-cdap-cluster-central/instances/rdm2c\\\"},\\r\\n \\\"namespace\\\": \\\"MTCA\\\",\\r\\n \\\"appNames\\\": [ \\\"cdap-mtca\\\" ],\\r\\n \\\"flowNames\\\": [ \\\"cdap-mtca.TCAVESCollectorFlow\\\" ],\\r\\n \\\"workerNames\\\": [\\\"cdap-mtca.TCADMaaPMRSubscriberWorker\\\", \\\"cdap-mtca.TCADMaaPMRPublisherWorker\\\"],\\r\\n \\\"serviceNames\\\" : [],\\r\\n \\\"apps\\\": {\\r\\n \\\"cdap-mtca\\\": {\\r\\n \\\"jarFile\\\": \\\"/opt/app/cdap-apps/dcae-analytics-mtca-1.0.0.jar\\\",\\r\\n \\\"artifactName\\\": \\\"dcae-analytics-mtca\\\",\\r\\n \\\"version\\\": \\\"1.0.0\\\",\\r\\n \\\"appConfigFileContent\\\": \\\"{config:{ \\\\\\\"appName\\\\\\\":\\\\\\\"cdap-mtca\\\\\\\", \\\\\\\"appDescription\\\\\\\":\\\\\\\"DCAE Analytics Threshold Crossing Alert Application\\\\\\\", \\\\\\\"tcaSubscriberOutputStreamName\\\\\\\":\\\\\\\"TCASubscriberOutputStream\\\\\\\", \\\\\\\"thresholdCalculatorFlowletInstances\\\\\\\":2, \\\\\\\"tcaVESMessageStatusTableName\\\\\\\":\\\\\\\"TCAVESMessageStatusTable\\\\\\\", \\\\\\\"tcaVESMessageStatusTableTTLSeconds\\\\\\\":864000, \\\\\\\"tcaVESAlertsTableName\\\\\\\":\\\\\\\"TCAVESAlertsTable\\\\\\\", \\\\\\\"tcaVESAlertsTableTTLSeconds\\\\\\\":1728000 }}\\\"\\r\\n }\\r\\n },\\r\\n \\r\\n \\\"configuration\\\": {\\r\\n \\\"$class\\\": \\\"com.att.ecomp.dcae.clamp.common.MThresholdCrossingConfiguration\\\",\\r\\n \\\"subscriberContentType\\\": \\\"\\\",\\r\\n \\\"subscriberConsumerId\\\": \\\"c12\\\",\\r\\n \\\"subscriberConsumerGroup\\\": \\\"OpenDCAE-c12\\\",\\r\\n \\\"subscriberTimeoutMS\\\": \\\"-1\\\",\\r\\n \\\"subscriberMessageLimit\\\": \\\"-1\\\",\\r\\n \\\"subscriberPollingInterval\\\": \\\"20000\\\",\\r\\n \\\"publisherContentType\\\": \\\"application/json\\\",\\r\\n \\\"publisherMaxBatchSize\\\": \\\"10\\\",\\r\\n \\\"publisherMaxRecoveryQueueSize\\\": \\\"100000\\\",\\r\\n \\\"publisherPollingInterval\\\": \\\"20000\\\",\\r\\n \\\"publisherAlertWindowingTime\\\": \\\"86400\\\",\\r\\n \\\"policyName\\\": \\\"policy.dcae.configuration\\\",\\r\\n \\\"policyScope\\\": \\\"pnf=eNodeB;type=configuration\\\",\\r\\n \\\"policyVersion\\\": \\\"1.0.0\\\",\\r\\n \\\"domain\\\" : \\\"measurementsForVfScaling\\\",\\r\\n \\r\\n \\\"signatures\\\" : {\\r\\n \\t }\\r\\n\\r\\n }\\r\\n }\\r\\n\"]}]}", - "imageText":"VESVesCollectorTCAPolicy" -} \ No newline at end of file diff --git a/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot b/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot new file mode 100644 index 000000000..7a45dbb80 --- /dev/null +++ b/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot @@ -0,0 +1,62 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library Selenium2Library +Library XvfbRobot + +*** Variables *** +${SELENIUM_SPEED_FAST} 0.2 seconds +${SELENIUM_SPEED_SLOW} 2 seconds + +*** Test Cases *** +Get Requests health check ok + CreateSession clamp http://localhost:8080 + ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck + Should Be Equal As Strings ${resp.status_code} 200 + +Open Browser +# Next line is to be enabled for Headless tests only (jenkins?). To see the tests disable the line. + Start Virtual Display 1920 1080 + Open Browser http://localhost:8080/designer/index.html browser=firefox + Set Selenium Speed ${SELENIUM_SPEED_SLOW} + Set Window Size 1920 1080 + ${title}= Get Title + Should Be Equal CLDS ${title} + +Good Login to Clamp UI and Verify logged in + Input Text locator=username text=admin + Input Text locator=password text=password + Press Key locator=password key=\\13 + Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 + Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin + +Create Model from Menu + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a + Wait Until Element Is Visible locator=Create CL timeout=60 + Click Element locator=Create CL + Input Text locator=modelName text=HolmesModel1 + Select From List By Label id=templateName templateHolmes1 + Click Button locator=Create + +Save Model from Menu + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a + Wait Until Element Is Visible locator=Save CL timeout=60 + Set Selenium Speed ${SELENIUM_SPEED_FAST} + Click Element locator=Save CL + Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 + Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE + Set Selenium Speed ${SELENIUM_SPEED_SLOW} + +Close Browser + Close Browser + +Verify Holmes CL well created + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names + Should Contain Match ${resp} *HolmesModel1* + Should Not Contain Match ${resp} *HolmesModel99* diff --git a/test/csit/tests/clamp/UIs/01__Create_TCA_template.robot b/test/csit/tests/clamp/UIs/01__Create_TCA_template.robot deleted file mode 100644 index 4bc0e6150..000000000 --- a/test/csit/tests/clamp/UIs/01__Create_TCA_template.robot +++ /dev/null @@ -1,81 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library Selenium2Library -Library XvfbRobot - - -*** Test Cases *** -Get Requests health check ok - CreateSession clamp http://localhost:8080 - ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck - Should Be Equal As Strings ${resp.status_code} 200 - -Open Browser -# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. - Start Virtual Display 1920 1080 - Open Browser http://localhost:8080/designer/index.html browser=firefox - Set Selenium Speed .2 seconds - Set Window Size 1920 1080 - ${title}= Get Title - Should Be Equal CLDS ${title} - -Bad Login to Clamp UI and Verify not logged in - Input Text locator=username text=bad_login - Input Text locator=password text=This_is_bad_password - Press Key locator=password key=\\13 - Wait Until Element Is Visible locator=username timeout=5 - Page Should Not Contain Element xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=*Hello:admin* - -Good Login to Clamp UI and Verify logged in - Input Text locator=username text=admin - Input Text locator=password text=password - Press Key locator=password key=\\13 - Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 - Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin - -Create Template from Menu - Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 - Click Element xpath=//*[@id="navbar"]/ul/li[1]/a - Wait Until Element Is Visible locator=Create Template timeout=60 - Click Element locator=Create Template - Input Text locator=modelName text=TCATemplate - Click Button locator=OK - -Drag and Drop Boxes for template - Wait Until Element Is Visible xpath=//*[@class="entry icon-ves-collector-node"] timeout=60 - Drag And Drop By Offset xpath=//*[@class="entry icon-ves-collector-node"] 280 280 - Drag And Drop By Offset xpath=//*[@class="entry icon-tca-node"] 480 280 - Drag And Drop By Offset xpath=//*[@class="entry icon-policy-node"] 680 280 - Drag And Drop By Offset xpath=//*[@class="entry icon-end-event-none"] 880 280 - -Drag and Drop Connectors for template - Click Element xpath=//*[starts-with(@data-element-id, "StartEvent_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[2]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[2]/div xpath=//*[starts-with(@data-element-id, "VesCollector_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[2]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[2]/div xpath=//*[starts-with(@data-element-id, "TCA_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "Policy_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[3]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "EndEvent_")] - -Add Template properties yaml from Menu - Click Element xpath=//*[@id="navbar"]/ul/li[1]/a - Wait Until Element Is Visible locator=Template Properties timeout=60 - Click Element locator=Template Properties - ${data}= Get Binary File ${CURDIR}${/}data${/}TCA_template_properties.yml - Input Text locator=service text=${data} - Click Button locator=Close - -Save Template from Menu - Click Element xpath=//*[@id="navbar"]/ul/li[1]/a - Wait Until Element Is Visible locator=Save Template timeout=60 - Click Element locator=Save Template - Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 - Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE - -Close Browser - Close Browser \ No newline at end of file diff --git a/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot b/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot index 9f287cac7..e0240721c 100644 --- a/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot +++ b/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot @@ -6,6 +6,9 @@ Library json Library Selenium2Library Library XvfbRobot +*** Variables *** +${SELENIUM_SPEED_FAST} 0.2 seconds +${SELENIUM_SPEED_SLOW} 2 seconds *** Test Cases *** Get Requests health check ok @@ -14,10 +17,10 @@ Get Requests health check ok Should Be Equal As Strings ${resp.status_code} 200 Open Browser -# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. +# Next line is to be enabled for Headless tests only (jenkins?). To see the tests disable the line. Start Virtual Display 1920 1080 Open Browser http://localhost:8080/designer/index.html browser=firefox - Set Selenium Speed .2 seconds + Set Selenium Speed ${SELENIUM_SPEED_SLOW} Set Window Size 1920 1080 ${title}= Get Title Should Be Equal CLDS ${title} @@ -31,20 +34,29 @@ Good Login to Clamp UI and Verify logged in Create Model from Menu Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[2]/a timeout=60 - Click Element xpath=//*[@id="navbar"]/ul/li[2]/a + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a Wait Until Element Is Visible locator=Create CL timeout=60 Click Element locator=Create CL - Input Text locator=modelName text=TCAModel - Select From List By Label id=templateName TCATemplate + Input Text locator=modelName text=TCAModel1 + Select From List By Label id=templateName templateTCA1 Click Button locator=Create Save Model from Menu - Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[2]/a timeout=60 - Click Element xpath=//*[@id="navbar"]/ul/li[2]/a + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a Wait Until Element Is Visible locator=Save CL timeout=60 + Set Selenium Speed ${SELENIUM_SPEED_FAST} Click Element locator=Save CL Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE + Set Selenium Speed ${SELENIUM_SPEED_SLOW} Close Browser Close Browser + +Verify TCA CL well create + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names + Should Contain Match ${resp} *TCAModel1* + Should Not Contain Match ${resp} *TCAModel99* diff --git a/test/csit/tests/clamp/UIs/03__Create_Holmes_template.robot b/test/csit/tests/clamp/UIs/03__Create_Holmes_template.robot deleted file mode 100644 index 5530715cd..000000000 --- a/test/csit/tests/clamp/UIs/03__Create_Holmes_template.robot +++ /dev/null @@ -1,66 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library Selenium2Library -Library XvfbRobot - - -*** Test Cases *** -Get Requests health check ok - CreateSession clamp http://localhost:8080 - ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck - Should Be Equal As Strings ${resp.status_code} 200 - -Open Browser -# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. - Start Virtual Display 1920 1080 - Open Browser http://localhost:8080/designer/index.html browser=firefox - Set Selenium Speed .2 seconds - Set Window Size 1920 1080 - ${title}= Get Title - Should Be Equal CLDS ${title} - -Good Login to Clamp UI and Verify logged in - Input Text locator=username text=admin - Input Text locator=password text=password - Press Key locator=password key=\\13 - Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 - Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin - -Create Template from Menu - Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 - Click Element xpath=//*[@id="navbar"]/ul/li[1]/a - Wait Until Element Is Visible locator=Create Template timeout=60 - Click Element locator=Create Template - Input Text locator=modelName text=HolmesTemplate - Click Button locator=OK - -Drag and Drop Boxes for template - Wait Until Element Is Visible xpath=//*[@class="entry icon-ves-collector-node"] timeout=60 - Drag And Drop By Offset xpath=//*[@class="entry icon-ves-collector-node"] 280 280 - Drag And Drop By Offset xpath=//*[@class="entry icon-holmes-node"] 480 280 - Drag And Drop By Offset xpath=//*[@class="entry icon-policy-node"] 680 280 - Drag And Drop By Offset xpath=//*[@class="entry icon-end-event-none"] 880 280 - -Drag and Drop Connectors for template - Click Element xpath=//*[starts-with(@data-element-id, "StartEvent_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[2]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[2]/div xpath=//*[starts-with(@data-element-id, "VesCollector_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[2]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[2]/div xpath=//*[starts-with(@data-element-id, "Holmes_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "Policy_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[3]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "EndEvent_")] - -Save Template from Menu - Click Element xpath=//*[@id="navbar"]/ul/li[1]/a - Wait Until Element Is Visible locator=Save Template timeout=60 - Click Element locator=Save Template - Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 - Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE - -Close Browser - Close Browser \ No newline at end of file diff --git a/test/csit/tests/clamp/UIs/04__Create_Holmes_model.robot b/test/csit/tests/clamp/UIs/04__Create_Holmes_model.robot deleted file mode 100644 index a531645a1..000000000 --- a/test/csit/tests/clamp/UIs/04__Create_Holmes_model.robot +++ /dev/null @@ -1,50 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library Selenium2Library -Library XvfbRobot - - -*** Test Cases *** -Get Requests health check ok - CreateSession clamp http://localhost:8080 - ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck - Should Be Equal As Strings ${resp.status_code} 200 - -Open Browser -# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. - Start Virtual Display 1920 1080 - Open Browser http://localhost:8080/designer/index.html browser=firefox - Set Selenium Speed .2 seconds - Set Window Size 1920 1080 - ${title}= Get Title - Should Be Equal CLDS ${title} - -Good Login to Clamp UI and Verify logged in - Input Text locator=username text=admin - Input Text locator=password text=password - Press Key locator=password key=\\13 - Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 - Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin - -Create Model from Menu - Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[2]/a timeout=60 - Click Element xpath=//*[@id="navbar"]/ul/li[2]/a - Wait Until Element Is Visible locator=Create CL timeout=60 - Click Element locator=Create CL - Input Text locator=modelName text=HolmesModel - Select From List By Label id=templateName HolmesTemplate - Click Button locator=Create - -Save Model from Menu - Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[2]/a timeout=60 - Click Element xpath=//*[@id="navbar"]/ul/li[2]/a - Wait Until Element Is Visible locator=Save CL timeout=60 - Click Element locator=Save CL - Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 - Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE - -Close Browser - Close Browser diff --git a/test/csit/tests/clamp/UIs/data/TCA_template_properties.yml b/test/csit/tests/clamp/UIs/data/TCA_template_properties.yml index 3e09fdad5..101dc2c0d 100644 --- a/test/csit/tests/clamp/UIs/data/TCA_template_properties.yml +++ b/test/csit/tests/clamp/UIs/data/TCA_template_properties.yml @@ -1,51 +1,82 @@ -tosca_definitions_version: cloudify_dsl_1_2 - +tosca_definitions_version: cloudify_dsl_1_3 imports: -- http://www.getcloudify.org/spec/cloudify/3.3.1/types.yaml -- http://127.0.0.1/1607_prod/type_files/cdap_app.yaml - +- http://www.getcloudify.org/spec/cloudify/3.4/types.yaml +- https://onap.org:8443/repository/solutioning01-mte2-raw/type_files/docker/2.2.0/node-type.yaml +- https://onap.org:8443/repository/solutioning01-mte2-raw/type_files/relationship/1.0.0/node-type.yaml +- http://onap.org:8081/repository/solutioning01-mte2-raw/type_files/dmaap/dmaap_mr.yaml +inputs: + location_id: + type: string + service_id: + type: string node_templates: - MTCA: - type: dcae.nodes.cdap_app + cdap_host_host: + type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure properties: - service_name: "cdap-mtca-central" - deployment_JSON: |- - { - "clusterService": {"$ref": "/services/vm-cdap-cluster-central/instances/rdm2c"}, - "namespace": "MTCA", - "appNames": [ "cdap-mtca" ], - "flowNames": [ "cdap-mtca.TCAVESCollectorFlow" ], - "workerNames": ["cdap-mtca.TCADMaaPMRSubscriberWorker", "cdap-mtca.TCADMaaPMRPublisherWorker"], - "serviceNames" : [], - "apps": { - "cdap-mtca": { - "jarFile": "/opt/app/cdap-apps/dcae-analytics-mtca-1.0.0.jar", - "artifactName": "dcae-analytics-mtca", - "version": "1.0.0", - "appConfigFileContent": "{config:{ \"appName\":\"cdap-mtca\", \"appDescription\":\"DCAE Analytics Threshold Crossing Alert Application\", \"tcaSubscriberOutputStreamName\":\"TCASubscriberOutputStream\", \"thresholdCalculatorFlowletInstances\":2, \"tcaVESMessageStatusTableName\":\"TCAVESMessageStatusTable\", \"tcaVESMessageStatusTableTTLSeconds\":864000, \"tcaVESAlertsTableName\":\"TCAVESAlertsTable\", \"tcaVESAlertsTableTTLSeconds\":1728000 }}" - } - }, - - "configuration": { - "$class": "com.att.ecomp.dcae.clamp.common.MThresholdCrossingConfiguration", - "subscriberContentType": "", - "subscriberConsumerId": "c12", - "subscriberConsumerGroup": "OpenDCAE-c12", - "subscriberTimeoutMS": "-1", - "subscriberMessageLimit": "-1", - "subscriberPollingInterval": "20000", - "publisherContentType": "application/json", - "publisherMaxBatchSize": "10", - "publisherMaxRecoveryQueueSize": "100000", - "publisherPollingInterval": "20000", - "publisherAlertWindowingTime": "86400", - "policyName": "policy.dcae.configuration", - "policyScope": "pnf=eNodeB;type=configuration", - "policyVersion": "1.0.0", - "domain" : "measurementsForVfScaling", - - "signatures" : { - } - - } - } + location_id: + get_input: location_id + scn_override: cdap_broker.solutioning-central.dcae.onap.org + interfaces: + cloudify.interfaces.lifecycle: { + } + tca_tca: + type: dcae.nodes.MicroService.cdap + properties: + app_config: + appDescription: DCAE Analytics Threshold Crossing Alert Application + appName: dcae-tca + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: '1728000' + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: '86400' + thresholdCalculatorFlowletInstances: '2' + app_preferences: + publisherContentType: application/json + publisherHostName: mrlocal-mtnjftle01.onap.org + publisherHostPort: '3905' + publisherMaxBatchSize: '10' + publisherMaxRecoveryQueueSize: '100000' + publisherPollingInterval: '20000' + publisherProtocol: https + publisherTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESPub + publisherUserName: m00502@tca.af.dcae.onap.org + publisherUserPassword: Te5021abc + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: mrlocal-mtnjftle01.onap.org + subscriberHostPort: '3905' + subscriberMessageLimit: '-1' + subscriberPollingInterval: '20000' + subscriberProtocol: https + subscriberTimeoutMS: '-1' + subscriberTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESSub + subscriberUserName: m00502@tca.af.dcae.onap.org + subscriberUserPassword: Te5021abc + tca_policy: null + artifact_name: dcae-analytics-tca + artifact_version: 1.0.0 + connections: + streams_publishes: [ + ] + streams_subscribes: [ + ] + jar_url: http://somejar + location_id: + get_input: location_id + namespace: cdap_tca_hi_lo + programs: + - program_id: TCAVESCollectorFlow + program_type: flows + - program_id: TCADMaaPMRSubscriberWorker + program_type: workers + - program_id: TCADMaaPMRPublisherWorker + program_type: workers + service_component_type: cdap_app_tca + service_id: + get_input: service_id + streamname: TCASubscriberOutputStream + relationships: + - target: cdap_host_host + type: dcae.relationships.component_contained_in \ No newline at end of file -- cgit 1.2.3-korg