blob: c82d1e6f5ecbf7002fdc1d30b797c760f06220f8 [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
econware7fb2a22018-08-08 16:07:29 +000011${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1
econward5340482018-08-08 14:05:22 +000012${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"}]}}
13${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 +000014${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 +000015${FEED_CONTENT_TYPE} application/vnd.att-dr.feed
16${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription
econwar92924972018-07-31 13:46:27 +000017
18*** Test Cases ***
19Run Feed Creation
20 [Documentation] Feed Creation
21 [Timeout] 1 minute
econward5340482018-08-08 14:05:22 +000022 ${resp}= PostCall ${TARGET_URL_FEED} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m
23 log ${TARGET_URL_FEED}
econwar92924972018-07-31 13:46:27 +000024 log ${resp.text}
25 Should Be Equal As Strings ${resp.status_code} 201
26 log 'JSON Response Code:'${resp}
27
econward5340482018-08-08 14:05:22 +000028Run Subscribe to Feed
29 [Documentation] Subscribe to Feed
30 [Timeout] 1 minute
31 ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n
32 log ${TARGET_URL_SUBSCRIBE}
33 log ${resp.text}
34 Should Be Equal As Strings ${resp.status_code} 201
35 log 'JSON Response Code:'${resp}
econwar92924972018-07-31 13:46:27 +000036
econware7fb2a22018-08-08 16:07:29 +000037Run Update Subscription
38 [Documentation] Update Subscription to suspend and change delivery credentials
39 [Timeout] 1 minute
40 ${resp}= PutCall ${TARGET_URL_SUBSCRIPTION} ${UPDATE_SUBSCRIPTION_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n
41 log ${TARGET_URL_SUBSCRIPTION}
42 log ${resp.text}
43 Should Be Equal As Strings ${resp.status_code} 200
44 log 'JSON Response Code:'${resp}
45 ${resp}= GetCall ${TARGET_URL_SUBSCRIPTION} ${SUBSCRIBE_CONTENT_TYPE} sg481n
46 log ${resp.text}
47 Should Contain ${resp.text} "password":"sg481n","user":"sg481n"
48 log 'JSON Response Code:'${resp}
49
econwar92924972018-07-31 13:46:27 +000050*** Keywords ***
econward5340482018-08-08 14:05:22 +000051PostCall
52 [Arguments] ${url} ${data} ${content_type} ${user}
53 ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type}
54 ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
55 [Return] ${resp}
econware7fb2a22018-08-08 16:07:29 +000056
57PutCall
58 [Arguments] ${url} ${data} ${content_type} ${user}
59 ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type}
60 ${resp}= Evaluate requests.put('${url}',data='${data}', headers=${headers},verify=False) requests
61 [Return] ${resp}
62
63GetCall
64 [Arguments] ${url} ${content_type} ${user}
65 ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type}
66 ${resp}= Evaluate requests.get('${url}', headers=${headers},verify=False) requests
67 [Return] ${resp}