From d4c5185856445e873485c6ae0b7e660ef47ae635 Mon Sep 17 00:00:00 2001 From: Chenfei Gao Date: Wed, 6 Feb 2019 20:45:10 -0500 Subject: Add csit test plans for policy-api Includes: 1) Added setup, teardown scripts and test plan 2) Added test robot including test cases Issue-ID: POLICY-1270 Change-Id: Id4fe5527609d9e13906d02bccc4ae8bc7c364bd9 Signed-off-by: Chenfei Gao --- tests/policy/api/api-test.robot | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/policy/api/api-test.robot (limited to 'tests') diff --git a/tests/policy/api/api-test.robot b/tests/policy/api/api-test.robot new file mode 100644 index 00000000..3753b3d8 --- /dev/null +++ b/tests/policy/api/api-test.robot @@ -0,0 +1,28 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json + +*** Test Cases *** +Healthcheck + [Documentation] Runs Policy Api Health check + ${auth}= Create List healthcheck zb!XztG34 + Log Creating session http://${POLICY_API_IP}:6969 + ${session}= Create Session policy http://${POLICY_API_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request policy /healthcheck headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.json()['code']} 200 + +Statistics + [Documentation] Runs Policy Api Statistics + ${auth}= Create List healthcheck zb!XztG34 + Log Creating session http://${POLICY_API_IP}:6969 + ${session}= Create Session policy http://${POLICY_API_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request policy /statistics headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.json()['code']} 200 \ No newline at end of file -- cgit 1.2.3-korg