aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-08-08 15:21:25 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-08 15:21:25 +0000
commit4e69c299dffa44b954195890c9e4a5683bf8b66a (patch)
tree0df15517e40b55dcda78909a1829e644575d68a3 /test
parent6aba10720c1e9a3dbadd72b4a233b3a5ee45529d (diff)
parentd53404812faa6482bbfd2f4d177791fbd6c907a4 (diff)
Merge "Add Subscribe to Feed Test Case"
Diffstat (limited to 'test')
-rwxr-xr-xtest/csit/plans/dmaap-datarouter/dr-suite/setup.sh1
-rwxr-xr-xtest/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot30
2 files changed, 22 insertions, 9 deletions
diff --git a/test/csit/plans/dmaap-datarouter/dr-suite/setup.sh b/test/csit/plans/dmaap-datarouter/dr-suite/setup.sh
index 31e4d1fae..c1bb75967 100755
--- a/test/csit/plans/dmaap-datarouter/dr-suite/setup.sh
+++ b/test/csit/plans/dmaap-datarouter/dr-suite/setup.sh
@@ -7,6 +7,7 @@ mkdir -p $WORKSPACE/archives/dmaapdr
cd $WORKSPACE/archives/dmaapdr
git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master
+cd datarouter
git pull
cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-prov/src/main/resources/docker-compose/
diff --git a/test/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot b/test/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot
index d1de683ef..527a9e2bd 100755
--- a/test/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot
+++ b/test/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot
@@ -6,23 +6,35 @@ Library Collections
Library String
*** Variables ***
-${TARGETURL_FEED} https://${DR_PROV_IP}:8443
-${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": ["${DR_PROV_IP}"], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}}
+${TARGET_URL_FEED} https://${DR_PROV_IP}:8443
+${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1
+${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": ["${DR_PROV_IP}"], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}}
+${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"}
+${FEED_CONTENT_TYPE} application/vnd.att-dr.feed
+${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription
*** Test Cases ***
Run Feed Creation
[Documentation] Feed Creation
[Timeout] 1 minute
- ${resp}= PostFeed ${TARGETURL_FEED} ${CREATE_FEED_DATA}
- log ${TARGETURL_FEED}
+ ${resp}= PostCall ${TARGET_URL_FEED} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m
+ log ${TARGET_URL_FEED}
log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 201
log 'JSON Response Code:'${resp}
+Run Subscribe to Feed
+ [Documentation] Subscribe to Feed
+ [Timeout] 1 minute
+ ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n
+ log ${TARGET_URL_SUBSCRIBE}
+ log ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 201
+ log 'JSON Response Code:'${resp}
*** Keywords ***
-PostFeed
- [Arguments] ${url} ${data}
- ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=rs873m Content-Type=application/vnd.att-dr.feed
- ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
- [Return] ${resp}
+PostCall
+ [Arguments] ${url} ${data} ${content_type} ${user}
+ ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type}
+ ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
+ [Return] ${resp}