aboutsummaryrefslogtreecommitdiffstats
path: root/csit/tests/osdf/resources/common-keywords.robot
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2021-03-18 11:40:51 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2021-03-18 13:11:50 +0530
commit6a281fdae4bba653c2345ce4b755b6d9d9cf97aa (patch)
treebb1f326625a5b0b7370348f7ba40556f52a50db9 /csit/tests/osdf/resources/common-keywords.robot
parent2ad946b1cb9fe0138b997fc2f56d2bf69e997780 (diff)
Add CSIT to the repo
Issue-ID: OPTFRA-930 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: Ic520caf5a2122d044de0e05b415d54955cd762a0
Diffstat (limited to 'csit/tests/osdf/resources/common-keywords.robot')
-rw-r--r--csit/tests/osdf/resources/common-keywords.robot50
1 files changed, 50 insertions, 0 deletions
diff --git a/csit/tests/osdf/resources/common-keywords.robot b/csit/tests/osdf/resources/common-keywords.robot
new file mode 100644
index 0000000..74232c5
--- /dev/null
+++ b/csit/tests/osdf/resources/common-keywords.robot
@@ -0,0 +1,50 @@
+*** Settings ***
+Documentation Suite description
+Library OperatingSystem
+Library RequestsLibrary
+Library json
+Library RequestsLibrary
+*** Variables ***
+&{headers}= Content-Type=application/json Accept=application/json
+*** Keywords ***
+Verify Docker RC Status
+ [Documentation] Method to verify whether docker instance is up and running
+ [Arguments] ${process_name}
+ ${rc} ${output}= Run and Return RC and Output docker ps
+ Log To Console *********************
+ Log To Console retrurn_code = ${rc}
+ Log To Console output = ${output}
+ Should Be Equal As Integers ${rc} 0
+ Should Contain ${output} ${process_name}
+
+Http Get
+ [Documentation] Wrapper for Http GET
+ [Arguments] ${host} ${restUrl}
+ Create Session optf-osdf ${host}
+ ${resp}= Get Request optf-osdf ${restUrl}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ [Return] ${resp}
+
+Http Post
+ [Documentation] Wrapper for Http POST
+ [Arguments] ${host} ${restUrl} ${auth} ${data}
+ ${pci_auth}= Create List ${auth['username']} ${auth['password']}
+ Create Session optf-osdf ${host} headers=${headers} auth=${pci_auth}
+ ${resp}= Post Request optf-osdf ${restUrl} data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ [Return] ${resp}
+
+Http Put
+ [Documentation] Wrapper for Http PUT
+ [Arguments] ${host} ${restUrl} ${auth} ${data}
+ ${pci_auth}= Create List ${auth['username']} ${auth['password']}
+ Create Session optf-osdf ${host} headers=${headers} auth=${pci_auth}
+ ${resp}= Put Request optf-osdf ${restUrl} data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ [Return] ${resp}