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 | 5dfc628 | 2018-08-08 16:35:40 +0000 | [diff] [blame] | 9 | ${TARGET_URL} https://${DR_PROV_IP}:8443 |
| 10 | ${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1 |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 11 | ${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1 |
econwar | e7fb2a2 | 2018-08-08 16:07:29 +0000 | [diff] [blame] | 12 | ${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1 |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 13 | ${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"}]}} |
econwar | 5dfc628 | 2018-08-08 16:35:40 +0000 | [diff] [blame] | 14 | ${UPDATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "UPDATED-CSIT_Test", "business_description": "CSIT_Test", "suspend": true, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": ["${DR_PROV_IP}"], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 15 | ${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"} |
econwar | e7fb2a2 | 2018-08-08 16:07:29 +0000 | [diff] [blame] | 16 | ${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"sg481n", "password":"sg481n", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"sg481n"} |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 17 | ${FEED_CONTENT_TYPE} application/vnd.att-dr.feed |
| 18 | ${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription |
econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame] | 19 | |
| 20 | *** Test Cases *** |
| 21 | Run Feed Creation |
| 22 | [Documentation] Feed Creation |
| 23 | [Timeout] 1 minute |
econwar | 5dfc628 | 2018-08-08 16:35:40 +0000 | [diff] [blame] | 24 | ${resp}= PostCall ${TARGET_URL} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m |
| 25 | log ${TARGET_URL} |
econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame] | 26 | log ${resp.text} |
| 27 | Should Be Equal As Strings ${resp.status_code} 201 |
| 28 | log 'JSON Response Code:'${resp} |
| 29 | |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 30 | Run Subscribe to Feed |
| 31 | [Documentation] Subscribe to Feed |
| 32 | [Timeout] 1 minute |
| 33 | ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n |
| 34 | log ${TARGET_URL_SUBSCRIBE} |
| 35 | log ${resp.text} |
| 36 | Should Be Equal As Strings ${resp.status_code} 201 |
| 37 | log 'JSON Response Code:'${resp} |
econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame] | 38 | |
econwar | e7fb2a2 | 2018-08-08 16:07:29 +0000 | [diff] [blame] | 39 | Run Update Subscription |
| 40 | [Documentation] Update Subscription to suspend and change delivery credentials |
| 41 | [Timeout] 1 minute |
| 42 | ${resp}= PutCall ${TARGET_URL_SUBSCRIPTION} ${UPDATE_SUBSCRIPTION_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n |
| 43 | log ${TARGET_URL_SUBSCRIPTION} |
| 44 | log ${resp.text} |
| 45 | Should Be Equal As Strings ${resp.status_code} 200 |
| 46 | log 'JSON Response Code:'${resp} |
| 47 | ${resp}= GetCall ${TARGET_URL_SUBSCRIPTION} ${SUBSCRIBE_CONTENT_TYPE} sg481n |
| 48 | log ${resp.text} |
| 49 | Should Contain ${resp.text} "password":"sg481n","user":"sg481n" |
| 50 | log 'JSON Response Code:'${resp} |
| 51 | |
econwar | 5dfc628 | 2018-08-08 16:35:40 +0000 | [diff] [blame] | 52 | Run Update Feed |
| 53 | [Documentation] Update Feed description and suspend |
| 54 | [Timeout] 1 minute |
| 55 | ${resp}= PutCall ${TARGET_URL_FEED} ${UPDATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m |
| 56 | log ${TARGET_URL_FEED} |
| 57 | log ${resp.text} |
| 58 | Should Be Equal As Strings ${resp.status_code} 200 |
| 59 | log 'JSON Response Code:'${resp} |
| 60 | ${resp}= GetCall ${TARGET_URL_FEED} ${FEED_CONTENT_TYPE} rs873m |
| 61 | log ${resp.text} |
| 62 | Should Contain ${resp.text} "UPDATED-CSIT_Test" |
| 63 | log 'JSON Response Code:'${resp} |
| 64 | |
econwar | 81708b8 | 2018-08-08 16:46:51 +0000 | [diff] [blame] | 65 | Run Delete Subscription |
| 66 | [Documentation] Delete Subscription |
| 67 | [Timeout] 1 minute |
| 68 | ${resp}= DeleteCall ${TARGET_URL_SUBSCRIPTION} sg481n |
| 69 | log ${resp.text} |
| 70 | Should Be Equal As Strings ${resp.status_code} 204 |
| 71 | log 'JSON Response Code:'${resp} |
| 72 | |
econwar | 6d5e808 | 2018-08-08 17:17:18 +0000 | [diff] [blame] | 73 | Run Delete Feed |
| 74 | [Documentation] Delete Feed |
| 75 | [Timeout] 1 minute |
| 76 | ${resp}= DeleteCall ${TARGET_URL_FEED} rs873m |
| 77 | log ${resp.text} |
| 78 | Should Be Equal As Strings ${resp.status_code} 204 |
| 79 | log 'JSON Response Code:'${resp} |
| 80 | |
econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame] | 81 | *** Keywords *** |
econwar | d534048 | 2018-08-08 14:05:22 +0000 | [diff] [blame] | 82 | PostCall |
| 83 | [Arguments] ${url} ${data} ${content_type} ${user} |
| 84 | ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} |
| 85 | ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests |
| 86 | [Return] ${resp} |
econwar | e7fb2a2 | 2018-08-08 16:07:29 +0000 | [diff] [blame] | 87 | |
| 88 | PutCall |
| 89 | [Arguments] ${url} ${data} ${content_type} ${user} |
| 90 | ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} |
| 91 | ${resp}= Evaluate requests.put('${url}',data='${data}', headers=${headers},verify=False) requests |
| 92 | [Return] ${resp} |
| 93 | |
| 94 | GetCall |
| 95 | [Arguments] ${url} ${content_type} ${user} |
| 96 | ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} |
| 97 | ${resp}= Evaluate requests.get('${url}', headers=${headers},verify=False) requests |
| 98 | [Return] ${resp} |
econwar | 81708b8 | 2018-08-08 16:46:51 +0000 | [diff] [blame] | 99 | |
| 100 | DeleteCall |
| 101 | [Arguments] ${url} ${user} |
| 102 | ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} |
| 103 | ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests |
| 104 | [Return] ${resp} |