From 6a281fdae4bba653c2345ce4b755b6d9d9cf97aa Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Thu, 18 Mar 2021 11:40:51 +0530 Subject: Add CSIT to the repo Issue-ID: OPTFRA-930 Signed-off-by: krishnaa96 Change-Id: Ic520caf5a2122d044de0e05b415d54955cd762a0 --- csit/tests/osdf/resources/common-keywords.robot | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 csit/tests/osdf/resources/common-keywords.robot (limited to 'csit/tests/osdf/resources/common-keywords.robot') 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} -- cgit 1.2.3-korg