econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library OperatingSystem |
| 3 | Library RequestsLibrary |
| 4 | Library requests |
| 5 | Library Collections |
| 6 | Library String |
| 7 | |
| 8 | *** Variables *** |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 9 | ${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 |
econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame] | 15 | |
| 16 | *** Test Cases *** |
| 17 | Run Feed Creation |
| 18 | [Documentation] Feed Creation |
| 19 | [Timeout] 1 minute |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 20 | ${resp}= PostCall ${TARGET_URL_FEED} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m |
| 21 | log ${TARGET_URL_FEED} |
econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame] | 22 | log ${resp.text} |
| 23 | Should Be Equal As Strings ${resp.status_code} 201 |
| 24 | log 'JSON Response Code:'${resp} |
| 25 | |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 26 | Run 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} |
econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame] | 34 | |
| 35 | *** Keywords *** |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 36 | PostCall |
| 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} |