blob: 79a5750efc70d25ca9621d2d7ab46beb26cdbe6b [file] [log] [blame]
vrvarma3fe70c72018-09-28 10:30:00 -04001*** Settings ***
2Library json
3Library OperatingSystem
4Resource ./resources/common-keywords.robot
5
6Suite Teardown Delete All Sessions
7
8*** Variables ***
9${osdf_host} ${OSDF_HOSTNAME}:${OSDF_PORT}
10&{placement_auth} = username=test password=testpwd
11&{wrong_authorization} = username=test password=test
12&{pci_auth}= username=pci_test password=pci_testpwd
13
14*** Test Cases ***
15Healthcheck
16 [Documentation] It sends a REST GET request to healthcheck url
17 ${resp}= Http Get ${osdf_host} /api/oof/v1/healthcheck
18 Should Be Equal As Integers ${resp.status_code} 200
19
20SendPlacementWithInvalidAuth
21 [Documentation] It sends a POST request to osdf fail authentication
22 ${data}= Get Binary File ${CURDIR}${/}data${/}placement_request.json
23 ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/placement data=${data} auth=${wrong_authorization}
24 ${response_json} json.loads ${resp.content}
25 Should Be Equal Unauthorized, check username and password ${response_json['serviceException']['text']}
26 Should Be Equal As Integers ${resp.status_code} 401
27
28SendPlacementWithValidAuth
29 [Documentation] It sends a POST request to osdf with correct authentication
30 ${data}= Get Binary File ${CURDIR}${/}data${/}placement_request.json
31 ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/placement data=${data} auth=${placement_auth}
32 ${response_json} json.loads ${resp.content}
33 Should Be Equal As Integers ${resp.status_code} 202
34 Should Be Equal accepted ${response_json['requestStatus']}
35
vrvarmac59a09a2020-03-18 15:59:21 -040036SendPCIOptimizationWithAuth
37 [Documentation] It sends a POST request PCI Optimization service
38
39 ${data}= Get Binary File ${CURDIR}${/}data${/}pci-opt-request.json
40 ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/pci data=${data} auth=${pci_auth}
41 ${response_json} json.loads ${resp.content}
42 Should Be Equal As Integers ${resp.status_code} 202
43 Should Be Equal accepted ${response_json['requestStatus']}
vrvarma3fe70c72018-09-28 10:30:00 -040044
45
46
47
48