blob: bf2c12b788a659c0d84bb14faea7e2b83663bd37 [file] [log] [blame]
Chenfei Gaod4c51852019-02-06 20:45:10 -05001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7*** Test Cases ***
8Healthcheck
9 [Documentation] Runs Policy Api Health check
10 ${auth}= Create List healthcheck zb!XztG34
Chenfei Gaofd967382019-02-12 15:52:37 -050011 Log Creating session https://${POLICY_API_IP}:6969
12 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth}
Chenfei Gaod4c51852019-02-06 20:45:10 -050013 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
Michael Mokry88f4d472019-03-04 12:00:05 -060014 ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers}
Chenfei Gaod4c51852019-02-06 20:45:10 -050015 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
19Statistics
20 [Documentation] Runs Policy Api Statistics
21 ${auth}= Create List healthcheck zb!XztG34
Chenfei Gaofd967382019-02-12 15:52:37 -050022 Log Creating session https://${POLICY_API_IP}:6969
23 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth}
Chenfei Gaod4c51852019-02-06 20:45:10 -050024 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
Michael Mokry88f4d472019-03-04 12:00:05 -060025 ${resp}= Get Request policy /policy/api/v1/statistics headers=${headers}
Chenfei Gaod4c51852019-02-06 20:45:10 -050026 Log Received response from policy ${resp.text}
27 Should Be Equal As Strings ${resp.status_code} 200
Chenfei Gaofd967382019-02-12 15:52:37 -050028 Should Be Equal As Strings ${resp.json()['code']} 200