diff options
author | vrvarma <vv8305@att.com> | 2018-09-28 10:30:00 -0400 |
---|---|---|
committer | vrvarma <vv8305@att.com> | 2018-10-03 22:56:37 -0400 |
commit | 3fe70c777050581f090f1bcc9ebf9e44857d0b56 (patch) | |
tree | 599724de7400629cdd3ddee32391816310035662 /tests/optf-osdf/osdf/resources | |
parent | bd341518ff41ddaa96afd22df6301075e7a8b4f5 (diff) |
Initial implementation of optf-osdf csit
Fixing osdf, simulator startup scripts
Split the setup & functional test cases
Add robot keywords for test suites
Refactoring test suites based on comments
Change-Id: Ic96343968ec919ac3c5272bc953bbaeb974f2393
Signed-off-by: vrvarma <vv8305@att.com>
Issue-ID: OPTFRA-286
Diffstat (limited to 'tests/optf-osdf/osdf/resources')
-rw-r--r-- | tests/optf-osdf/osdf/resources/common-keywords.robot | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/optf-osdf/osdf/resources/common-keywords.robot b/tests/optf-osdf/osdf/resources/common-keywords.robot new file mode 100644 index 00000000..ea45f09d --- /dev/null +++ b/tests/optf-osdf/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} headers=${headers} + 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}
\ No newline at end of file |