diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2018-08-08 15:21:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-08-08 15:21:25 +0000 |
commit | 4e69c299dffa44b954195890c9e4a5683bf8b66a (patch) | |
tree | 0df15517e40b55dcda78909a1829e644575d68a3 /test/csit/tests/dmaap-datarouter | |
parent | 6aba10720c1e9a3dbadd72b4a233b3a5ee45529d (diff) | |
parent | d53404812faa6482bbfd2f4d177791fbd6c907a4 (diff) |
Merge "Add Subscribe to Feed Test Case"
Diffstat (limited to 'test/csit/tests/dmaap-datarouter')
-rwxr-xr-x | test/csit/tests/dmaap-datarouter/dr-suite/dr-suite.robot | 30 |
1 files changed, 21 insertions, 9 deletions
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} |