aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/holmes/testcase/CommonKeywords
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-09-04 18:26:10 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2017-09-04 18:29:05 +0800
commit603b27eec9586eabb2e2d765243a3be0bf15c14c (patch)
treee516fe2d9371ffdfa983421104e5195b32fa5bdb /test/csit/tests/holmes/testcase/CommonKeywords
parentab395aba7794a7f3739205e80a2cd9c3546b7534 (diff)
Initial Submission of Holmes CSIT Configurations
Add shell scripts Add test case implemetations Change-Id: I94c11e83ee50725bc11ed2a21e16491bbaf26749 Issue-ID: HOLMES-39 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'test/csit/tests/holmes/testcase/CommonKeywords')
-rw-r--r--test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot b/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot
new file mode 100644
index 000000000..5b8417404
--- /dev/null
+++ b/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot
@@ -0,0 +1,37 @@
+*** Settings ***
+Library Collections
+Library RequestsLibrary
+Resource ../RuleMgt/Rule-Keywords.robot
+
+*** Keywords ***
+httpPut
+ [Arguments] ${restHost} ${restUrl} ${data}
+ ${headers} create dictionary Content-Type=application/json;charset=utf-8 Accept=application/json
+ create session microservices ${restHost} ${headers}
+ log ${data}
+ ${putResponse} put request microservices ${restUrl} ${data} \ ${EMPTY}
+ ... ${headers}
+ log ${putResponse}
+ [Return] ${putResponse}
+
+httpGet
+ [Arguments] ${restHost} ${restUrl}
+ create session microservices ${restHost}
+ ${getResponse} get request microservices ${restUrl}
+ [Return] ${getResponse}
+
+httpPost
+ [Arguments] ${restHost} ${restUrl} ${data}
+ ${headers} create dictionary Content-Type=application/json Accept=application/json
+ create session microservices ${restHost} ${headers}
+ log ${data}
+ ${postResponse} post request microservices ${restUrl} ${data}
+ Comment log ${postResponse.content}
+ [Return] ${postResponse}
+
+httpDelete
+ [Arguments] ${restHost} ${restUrl} ${data}
+ ${headers} create dictionary Content-Type=application/json Accept=application/json
+ create session microservices ${restHost} ${headers}
+ ${deleteResponse} delete request microservices ${restUrl} ${data}
+ [Return] ${deleteResponse}