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/optf_osdf_test.robot | |
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/optf_osdf_test.robot')
-rw-r--r-- | tests/optf-osdf/osdf/optf_osdf_test.robot | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/optf-osdf/osdf/optf_osdf_test.robot b/tests/optf-osdf/osdf/optf_osdf_test.robot new file mode 100644 index 00000000..c3921d5c --- /dev/null +++ b/tests/optf-osdf/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']} + + + + + |