aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot
diff options
context:
space:
mode:
authorwejs <maciej.wejs@nokia.com>2018-05-25 13:58:11 +0200
committerwejs <maciej.wejs@nokia.com>2018-05-25 14:20:41 +0200
commit060bc42881341b5b6259bc43895ab1ab5626189c (patch)
tree8bfbc334b0ef71e6077d2e690ee5e780c396bb2b /test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot
parent0d28fe6e20d46380a25ac7e17a01b11cabe63db4 (diff)
Initial testcase with docker-compose for PRH
Test without usage of previously committed robotframework. To be done later on. Now just to check whether it works with CI. Change-Id: I94ae148e727db3820cf7eb93ba2a4286d176bfbc Issue-ID: INT-510 Signed-off-by: wejs <maciej.wejs@nokia.com>
Diffstat (limited to 'test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot')
-rw-r--r--test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot b/test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot
new file mode 100644
index 000000000..bb7e3cac1
--- /dev/null
+++ b/test/csit/tests/dcaegen2/prh_testcases/prh_tests.robot
@@ -0,0 +1,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} \ No newline at end of file