diff options
author | krishnaa96 <krishna.moorthy6@wipro.com> | 2021-03-18 11:40:51 +0530 |
---|---|---|
committer | Hariharan Ramanathan <rh20085046@wipro.com> | 2021-03-23 08:22:47 +0000 |
commit | 006bf2b980ee3d267779723d27b26d4dee4d966e (patch) | |
tree | bb1f326625a5b0b7370348f7ba40556f52a50db9 /csit/tests/osdf/optf_osdf_test.robot | |
parent | 2ad946b1cb9fe0138b997fc2f56d2bf69e997780 (diff) |
Add CSIT to the repo
Issue-ID: OPTFRA-930
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: Ic520caf5a2122d044de0e05b415d54955cd762a0
(cherry picked from commit 6a281fdae4bba653c2345ce4b755b6d9d9cf97aa)
Diffstat (limited to 'csit/tests/osdf/optf_osdf_test.robot')
-rw-r--r-- | csit/tests/osdf/optf_osdf_test.robot | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/csit/tests/osdf/optf_osdf_test.robot b/csit/tests/osdf/optf_osdf_test.robot new file mode 100644 index 0000000..79a5750 --- /dev/null +++ b/csit/tests/osdf/optf_osdf_test.robot @@ -0,0 +1,48 @@ +*** Settings *** +Library json +Library OperatingSystem +Resource ./resources/common-keywords.robot + +Suite Teardown Delete All Sessions + +*** Variables *** +${osdf_host} ${OSDF_HOSTNAME}:${OSDF_PORT} +&{placement_auth} = username=test password=testpwd +&{wrong_authorization} = username=test password=test +&{pci_auth}= username=pci_test password=pci_testpwd + +*** Test Cases *** +Healthcheck + [Documentation] It sends a REST GET request to healthcheck url + ${resp}= Http Get ${osdf_host} /api/oof/v1/healthcheck + Should Be Equal As Integers ${resp.status_code} 200 + +SendPlacementWithInvalidAuth + [Documentation] It sends a POST request to osdf fail authentication + ${data}= Get Binary File ${CURDIR}${/}data${/}placement_request.json + ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/placement data=${data} auth=${wrong_authorization} + ${response_json} json.loads ${resp.content} + Should Be Equal Unauthorized, check username and password ${response_json['serviceException']['text']} + Should Be Equal As Integers ${resp.status_code} 401 + +SendPlacementWithValidAuth + [Documentation] It sends a POST request to osdf with correct authentication + ${data}= Get Binary File ${CURDIR}${/}data${/}placement_request.json + ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/placement data=${data} auth=${placement_auth} + ${response_json} json.loads ${resp.content} + Should Be Equal As Integers ${resp.status_code} 202 + Should Be Equal accepted ${response_json['requestStatus']} + +SendPCIOptimizationWithAuth + [Documentation] It sends a POST request PCI Optimization service + + ${data}= Get Binary File ${CURDIR}${/}data${/}pci-opt-request.json + ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/pci data=${data} auth=${pci_auth} + ${response_json} json.loads ${resp.content} + Should Be Equal As Integers ${resp.status_code} 202 + Should Be Equal accepted ${response_json['requestStatus']} + + + + + |