blob: 527a9e2bd1a69dcf50d3329d919e45060ef70e8d [file] [log] [blame]
econwar92924972018-07-31 13:46:27 +00001*** Settings ***
2Library OperatingSystem
3Library RequestsLibrary
4Library requests
5Library Collections
6Library String
7
8*** Variables ***
econward5340482018-08-08 14:05:22 +00009${TARGET_URL_FEED} https://${DR_PROV_IP}:8443
10${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1
11${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"}]}}
12${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"}
13${FEED_CONTENT_TYPE} application/vnd.att-dr.feed
14${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription
econwar92924972018-07-31 13:46:27 +000015
16*** Test Cases ***
17Run Feed Creation
18 [Documentation] Feed Creation
19 [Timeout] 1 minute
econward5340482018-08-08 14:05:22 +000020 ${resp}= PostCall ${TARGET_URL_FEED} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m
21 log ${TARGET_URL_FEED}
econwar92924972018-07-31 13:46:27 +000022 log ${resp.text}
23 Should Be Equal As Strings ${resp.status_code} 201
24 log 'JSON Response Code:'${resp}
25
econward5340482018-08-08 14:05:22 +000026Run Subscribe to Feed
27 [Documentation] Subscribe to Feed
28 [Timeout] 1 minute
29 ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n
30 log ${TARGET_URL_SUBSCRIBE}
31 log ${resp.text}
32 Should Be Equal As Strings ${resp.status_code} 201
33 log 'JSON Response Code:'${resp}
econwar92924972018-07-31 13:46:27 +000034
35*** Keywords ***
econward5340482018-08-08 14:05:22 +000036PostCall
37 [Arguments] ${url} ${data} ${content_type} ${user}
38 ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type}
39 ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
40 [Return] ${resp}