blob: bb7e3cac1bb23fd8bed3b232ac771dfb41b6175e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
*** Settings ***
Library OperatingSystem
Library RequestsLibrary
Library requests
Library Collections
Library String
*** Variables ***
${PNF_REGISTER_URL} http://${DMAAP_SIMULATOR}/events/unauthenticated.SEC_OTHER_OUTPUT
${PNF_READY_URL} http://${DMAAP_SIMULATOR}/events/pnfReady
${PRH_START_URL} http://${PRH}/start
${PNF_REGISTER_EVENT} %{WORKSPACE}/test/csit/tests/prh/testcases/resources/events/pnf_register_event.json
*** Test Cases ***
Run Posting and Consuming
[Documentation] Post message to new topic and consume it
[Timeout] 1 minute
${req_data}= Get Binary File ${PNF_REGISTER_EVENT}
${resp}= PostCall ${PNF_REGISTER_URL} ${req_data}
log ${PNF_REGISTER_URL}
log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
# ${count}= Evaluate $resp.json().get('count')
log 'JSON Response Code:' ${resp}
${resp}= GetCall ${PRH_START_URL}
log ${PRH_START_URL}
log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 201
${resp}= GetCall ${PNF_READY_URL}
log ${PNF_READY_URL}
log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
log 'JSON Response Code:' ${resp}
*** Keywords ***
PostCall
[Arguments] ${url} ${data}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
[Return] ${resp}
GetCall
[Arguments] ${url}
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
${resp}= Evaluate requests.get('${url}', headers=${headers}, verify=False) requests
[Return] ${resp}
|