From 18e5406e2f060cc7b876e9deb8a10503fcf14eed Mon Sep 17 00:00:00 2001 From: Varun Gudisena Date: Thu, 21 Sep 2017 20:25:18 +0000 Subject: Add CSIT for DMAAP MR Added Robot scripts and shell scripts for DMAAP MR issue-id: DMAAP-105 Change-Id: I06a7028d7c59743220ca5153c8193e6ebc73c65e Signed-off-by: Varun Gudisena --- test/csit/tests/dmaap/mrpubsub/mrpubsub.robot | 73 +++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 test/csit/tests/dmaap/mrpubsub/mrpubsub.robot (limited to 'test/csit/tests') diff --git a/test/csit/tests/dmaap/mrpubsub/mrpubsub.robot b/test/csit/tests/dmaap/mrpubsub/mrpubsub.robot new file mode 100755 index 000000000..c711bd754 --- /dev/null +++ b/test/csit/tests/dmaap/mrpubsub/mrpubsub.robot @@ -0,0 +1,73 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library requests +Library Collections +Library String + +*** Variables *** +${TARGETURL_PUBLISH} http://${DMAAP_MR_IP}:3904/events/TestTopic1 +${TARGETURL_TOPICS} http://${DMAAP_MR_IP}:3904/topics +${TARGETURL_SUBSCR} http://${DMAAP_MR_IP}:3904/events/TestTopic1/CG1/C1?timeout=1000 +${TEST_DATA} {"topicName": "TestTopic1"} +${TOPIC_DATA} {"topicName":"FirstTopic","topicDescription":"This is a TestTopic","partitionCount":"1","replicationCount":"3","transactionEnabled":"true"} + +*** Test Cases *** +Run Topic Creation and Publish + [Documentation] Topic Creation + [Timeout] 1 minute + ${resp}= PostCall ${TARGETURL_PUBLISH} ${TEST_DATA} + log ${TARGETURL_PUBLISH} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${count}= Evaluate $resp.json().get('count') + log 'JSON Response Code:'${resp} + +Run Subscribing a message status + [Documentation] Subscribide message status + [Timeout] 1 minute + ${resp}= GetCall ${TARGETURL_SUBSCR} + log ${TARGETURL_SUBSCR} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code :'${resp} + +Run check topics are exisiting + [Documentation] Get the count of the Topics + [Timeout] 1 minute + ${resp}= GetCall ${TARGETURL_TOPICS} + log ${TARGETURL_TOPICS} + Should Be Equal As Strings ${resp.status_code} 200 + log 'JSON Response Code :'${resp} + ${topics}= Evaluate $resp.json().get('topics') + log ${topics} + ${ListLength}= Get Length ${topics} + log ${ListLength} + List Should Contain Value ${topics} TestTopic1 + +Run Publich and Subscribe a message + [Documentation] Publish and Subscribe the message + [Timeout] 1 minute + ${resp}= PostCall ${TARGETURL_PUBLISH} ${TEST_DATA} + log ${TARGETURL_PUBLISH} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${sub_resp}= GetCall ${TARGETURL_SUBSCR} + log ${TARGETURL_SUBSCR} + Should Be Equal As Strings ${sub_resp.status_code} 200 + log 'JSON Response Code :'${sub_resp} + ${ListLength}= Get Length ${sub_resp.json()} + log ${ListLength} + List Should Contain Value ${sub_resp.json()} {"topicName":"TestTopic1"} case_insensitive=yes + +*** Keywords *** +PostCall + [Arguments] ${url} ${data} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +GetCall + [Arguments] ${url} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.get('${url}', headers=${headers}, verify=False) requests + [Return] ${resp} -- cgit 1.2.3-korg