blob: fcac20263070b01d446c0eb59d1b9d8797286a77 [file] [log] [blame]
econwar92924972018-07-31 13:46:27 +00001*** Settings ***
2Library OperatingSystem
3Library RequestsLibrary
4Library requests
5Library Collections
6Library String
7
8*** Variables ***
econwar5dfc6282018-08-08 16:35:40 +00009${TARGET_URL} https://${DR_PROV_IP}:8443
10${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1
econward5340482018-08-08 14:05:22 +000011${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1
econware7fb2a22018-08-08 16:07:29 +000012${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1
econwar18088d82018-08-09 14:21:29 +000013${TARGET_URL_PUBLISH} https://${DR_NODE_IP}:8443/publish/1/csit_test
econwar7747f1d2018-08-21 16:45:34 +000014${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": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}}
15${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": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}}
econward5340482018-08-08 14:05:22 +000016${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"}
econware7fb2a22018-08-08 16:07:29 +000017${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"sg481n", "password":"sg481n", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"sg481n"}
econward5340482018-08-08 14:05:22 +000018${FEED_CONTENT_TYPE} application/vnd.att-dr.feed
19${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription
econwar18088d82018-08-09 14:21:29 +000020${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream
econwar92924972018-07-31 13:46:27 +000021
22*** Test Cases ***
23Run Feed Creation
24 [Documentation] Feed Creation
25 [Timeout] 1 minute
econwar5dfc6282018-08-08 16:35:40 +000026 ${resp}= PostCall ${TARGET_URL} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m
27 log ${TARGET_URL}
econwar92924972018-07-31 13:46:27 +000028 log ${resp.text}
29 Should Be Equal As Strings ${resp.status_code} 201
30 log 'JSON Response Code:'${resp}
31
econward5340482018-08-08 14:05:22 +000032Run Subscribe to Feed
33 [Documentation] Subscribe to Feed
34 [Timeout] 1 minute
35 ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n
36 log ${TARGET_URL_SUBSCRIBE}
37 log ${resp.text}
38 Should Be Equal As Strings ${resp.status_code} 201
39 log 'JSON Response Code:'${resp}
econwar92924972018-07-31 13:46:27 +000040
econwar18088d82018-08-09 14:21:29 +000041Run Publish Feed
42 [Documentation] Publish to Feed
43 [Timeout] 1 minute
44 Sleep 10s Behaviour was noticed where feed was not created in time for publish to be sent
45 ${resp}= PutCall ${TARGET_URL_PUBLISH} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} rs873m
46 log ${TARGET_URL_PUBLISH}
47 log ${resp.text}
48 Should Be Equal As Strings ${resp.status_code} 204
49 log 'JSON Response Code:'${resp}
50
econware7fb2a22018-08-08 16:07:29 +000051Run Update Subscription
52 [Documentation] Update Subscription to suspend and change delivery credentials
53 [Timeout] 1 minute
54 ${resp}= PutCall ${TARGET_URL_SUBSCRIPTION} ${UPDATE_SUBSCRIPTION_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n
55 log ${TARGET_URL_SUBSCRIPTION}
56 log ${resp.text}
57 Should Be Equal As Strings ${resp.status_code} 200
58 log 'JSON Response Code:'${resp}
59 ${resp}= GetCall ${TARGET_URL_SUBSCRIPTION} ${SUBSCRIBE_CONTENT_TYPE} sg481n
60 log ${resp.text}
61 Should Contain ${resp.text} "password":"sg481n","user":"sg481n"
62 log 'JSON Response Code:'${resp}
63
econwar5dfc6282018-08-08 16:35:40 +000064Run Update Feed
65 [Documentation] Update Feed description and suspend
66 [Timeout] 1 minute
67 ${resp}= PutCall ${TARGET_URL_FEED} ${UPDATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m
68 log ${TARGET_URL_FEED}
69 log ${resp.text}
70 Should Be Equal As Strings ${resp.status_code} 200
71 log 'JSON Response Code:'${resp}
72 ${resp}= GetCall ${TARGET_URL_FEED} ${FEED_CONTENT_TYPE} rs873m
73 log ${resp.text}
74 Should Contain ${resp.text} "UPDATED-CSIT_Test"
75 log 'JSON Response Code:'${resp}
76
econwar81708b82018-08-08 16:46:51 +000077Run Delete Subscription
78 [Documentation] Delete Subscription
79 [Timeout] 1 minute
80 ${resp}= DeleteCall ${TARGET_URL_SUBSCRIPTION} sg481n
81 log ${resp.text}
82 Should Be Equal As Strings ${resp.status_code} 204
83 log 'JSON Response Code:'${resp}
84
econwar6d5e8082018-08-08 17:17:18 +000085Run Delete Feed
86 [Documentation] Delete Feed
87 [Timeout] 1 minute
88 ${resp}= DeleteCall ${TARGET_URL_FEED} rs873m
89 log ${resp.text}
90 Should Be Equal As Strings ${resp.status_code} 204
91 log 'JSON Response Code:'${resp}
92
econwar92924972018-07-31 13:46:27 +000093*** Keywords ***
econward5340482018-08-08 14:05:22 +000094PostCall
95 [Arguments] ${url} ${data} ${content_type} ${user}
96 ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type}
97 ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
98 [Return] ${resp}
econware7fb2a22018-08-08 16:07:29 +000099
100PutCall
101 [Arguments] ${url} ${data} ${content_type} ${user}
econwar18088d82018-08-09 14:21:29 +0000102 ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} Authorization=Basic cnM4NzNtOnJzODczbQ==
econware7fb2a22018-08-08 16:07:29 +0000103 ${resp}= Evaluate requests.put('${url}',data='${data}', headers=${headers},verify=False) requests
104 [Return] ${resp}
105
106GetCall
107 [Arguments] ${url} ${content_type} ${user}
108 ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type}
109 ${resp}= Evaluate requests.get('${url}', headers=${headers},verify=False) requests
110 [Return] ${resp}
econwar81708b82018-08-08 16:46:51 +0000111
112DeleteCall
113 [Arguments] ${url} ${user}
114 ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user}
115 ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests
116 [Return] ${resp}