2 Library OperatingSystem
3 Library RequestsLibrary
9 ${PNF_REGISTER_URL} http://${DMAAP_SIMULATOR}/events/unauthenticated.SEC_OTHER_OUTPUT
10 ${PNF_READY_URL} http://${DMAAP_SIMULATOR}/events/pnfReady
11 ${PRH_START_URL} http://${PRH}/start
12 ${PNF_REGISTER_EVENT} %{WORKSPACE}/test/csit/tests/prh/testcases/resources/events/pnf_register_event.json
16 Run Posting and Consuming
17 [Documentation] Post message to new topic and consume it
19 ${req_data}= Get Binary File ${PNF_REGISTER_EVENT}
20 ${resp}= PostCall ${PNF_REGISTER_URL} ${req_data}
21 log ${PNF_REGISTER_URL}
23 Should Be Equal As Strings ${resp.status_code} 200
24 # ${count}= Evaluate $resp.json().get('count')
25 log 'JSON Response Code:' ${resp}
26 ${resp}= GetCall ${PRH_START_URL}
29 Should Be Equal As Strings ${resp.status_code} 201
30 ${resp}= GetCall ${PNF_READY_URL}
33 Should Be Equal As Strings ${resp.status_code} 200
34 log 'JSON Response Code:' ${resp}
39 [Arguments] ${url} ${data}
40 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
41 ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
46 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
47 ${resp}= Evaluate requests.get('${url}', headers=${headers}, verify=False) requests