From 9c0b46832ff031e337a13358eb83752c853aa1fc Mon Sep 17 00:00:00 2001 From: eh552t Date: Mon, 21 Aug 2017 11:10:11 +0200 Subject: initial integration tests for CLAMP Commit the first test for CLAMP, UIs and TCA first Change-Id: I902e7ea79210c114eaf03943a83ac71bbfbf012e Signed-off-by: eh552t Issue-Id: CLAMP-33 --- test/csit/tests/clamp/TCA/__init__.robot | 2 ++ .../csit/tests/clamp/TCA/data/createTemplate1.json | 7 ++++ .../csit/tests/clamp/TCA/data/createTemplate2.json | 7 ++++ test/csit/tests/clamp/TCA/test1.robot | 38 ++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 test/csit/tests/clamp/TCA/__init__.robot create mode 100644 test/csit/tests/clamp/TCA/data/createTemplate1.json create mode 100644 test/csit/tests/clamp/TCA/data/createTemplate2.json create mode 100644 test/csit/tests/clamp/TCA/test1.robot (limited to 'test/csit/tests/clamp/TCA') diff --git a/test/csit/tests/clamp/TCA/__init__.robot b/test/csit/tests/clamp/TCA/__init__.robot new file mode 100644 index 000000000..5da0c75fa --- /dev/null +++ b/test/csit/tests/clamp/TCA/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Clamp - TCA diff --git a/test/csit/tests/clamp/TCA/data/createTemplate1.json b/test/csit/tests/clamp/TCA/data/createTemplate1.json new file mode 100644 index 000000000..0b08d5881 --- /dev/null +++ b/test/csit/tests/clamp/TCA/data/createTemplate1.json @@ -0,0 +1,7 @@ +{ + "name": "template1", + "controlNamePrefix": "ClosedLoop-", + "bpmnText": " SequenceFlow_0wokvsg SequenceFlow_0wokvsg SequenceFlow_0w8129u SequenceFlow_0w8129u SequenceFlow_0bdkahu SequenceFlow_0bdkahu SequenceFlow_039geog SequenceFlow_039geog ", + "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://135.207.127.211/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 }\"]}]}", + "imageText":"CollectorTCAPolicy" +} \ No newline at end of file diff --git a/test/csit/tests/clamp/TCA/data/createTemplate2.json b/test/csit/tests/clamp/TCA/data/createTemplate2.json new file mode 100644 index 000000000..84f7c06e9 --- /dev/null +++ b/test/csit/tests/clamp/TCA/data/createTemplate2.json @@ -0,0 +1,7 @@ +{ + "name": "template2", + "controlNamePrefix": "ClosedLoop-", + "bpmnText": " SequenceFlow_0wokvsg SequenceFlow_0wokvsg SequenceFlow_0w8129u SequenceFlow_0w8129u SequenceFlow_0bdkahu SequenceFlow_0bdkahu SequenceFlow_039geog SequenceFlow_039geog ", + "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://135.207.127.211/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 }\"]}]}", + "imageText":"CollectorTCAPolicy" +} \ No newline at end of file diff --git a/test/csit/tests/clamp/TCA/test1.robot b/test/csit/tests/clamp/TCA/test1.robot new file mode 100644 index 000000000..e9b630f72 --- /dev/null +++ b/test/csit/tests/clamp/TCA/test1.robot @@ -0,0 +1,38 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library HttpLibrary.HTTP + + +*** 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 template1 with yaml properties + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate1.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template1 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Put Requests to add template2 with yaml properties + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate2.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template2 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify 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} *template1* + Should Contain Match ${resp} *template2* + Should Not Contain Match ${resp} *template99* -- cgit 1.2.3-korg