Chenfei Gao | d4c5185 | 2019-02-06 20:45:10 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | |
| 7 | *** Test Cases *** |
| 8 | Healthcheck |
| 9 | [Documentation] Runs Policy Api Health check |
| 10 | ${auth}= Create List healthcheck zb!XztG34 |
Chenfei Gao | fd96738 | 2019-02-12 15:52:37 -0500 | [diff] [blame] | 11 | Log Creating session https://${POLICY_API_IP}:6969 |
| 12 | ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} |
Chenfei Gao | d4c5185 | 2019-02-06 20:45:10 -0500 | [diff] [blame] | 13 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Michael Mokry | 88f4d47 | 2019-03-04 12:00:05 -0600 | [diff] [blame^] | 14 | ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers} |
Chenfei Gao | d4c5185 | 2019-02-06 20:45:10 -0500 | [diff] [blame] | 15 | Log Received response from policy ${resp.text} |
| 16 | Should Be Equal As Strings ${resp.status_code} 200 |
| 17 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 18 | |
| 19 | Statistics |
| 20 | [Documentation] Runs Policy Api Statistics |
| 21 | ${auth}= Create List healthcheck zb!XztG34 |
Chenfei Gao | fd96738 | 2019-02-12 15:52:37 -0500 | [diff] [blame] | 22 | Log Creating session https://${POLICY_API_IP}:6969 |
| 23 | ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} |
Chenfei Gao | d4c5185 | 2019-02-06 20:45:10 -0500 | [diff] [blame] | 24 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Michael Mokry | 88f4d47 | 2019-03-04 12:00:05 -0600 | [diff] [blame^] | 25 | ${resp}= Get Request policy /policy/api/v1/statistics headers=${headers} |
Chenfei Gao | d4c5185 | 2019-02-06 20:45:10 -0500 | [diff] [blame] | 26 | Log Received response from policy ${resp.text} |
| 27 | Should Be Equal As Strings ${resp.status_code} 200 |
Chenfei Gao | fd96738 | 2019-02-12 15:52:37 -0500 | [diff] [blame] | 28 | Should Be Equal As Strings ${resp.json()['code']} 200 |