aboutsummaryrefslogtreecommitdiffstats
path: root/csit/resources/tests/api-slas.robot
blob: c5feb728775380165b2ec5649d0f791e78944d08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
*** Settings ***
Library    Collections
Library    RequestsLibrary
Library    OperatingSystem
Library    json
Resource    ${CURDIR}/common-library.robot

*** Keywords ***
ValidateResponseTimeForApi
    [Arguments]  ${uri}  ${method}
    [Documentation]  Check if uri response is under the 500ms required time for api metrics
    ValidateResponseTime  api-metrics  ${uri}  ${method}  500

*** Test Cases ***
WaitForPrometheusServer
    [Documentation]  Sleep time to wait for Prometheus server to gather all metrics
    Sleep    1 minute

ValidateResponseTimeForHealthcheck
    [Documentation]  Validate component healthcheck response time
    ValidateResponseTimeForApi  /healthcheck  GET

ValidateResponseTimeForStatistics
    [Documentation]  Validate statistics response time
    ValidateResponseTimeForApi  /statistics  GET

ValidateResponseTimeQueryPolicies
    [Documentation]  Validate query policies response time
    ValidateResponseTimeForApi  /policies  GET

ValidateResponseTimeQueryPolicyVersion
    [Documentation]  Validate query policy by version response time
    ValidateResponseTimeForApi  /policies/{policyId}/versions/{policyVersion}  GET

ValidateResponseTimeCreatePolicy
    [Documentation]  Validate response time for creating a policy
    ValidateResponseTimeForApi  /policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies  POST

ValidateResponseTimeCreatePolicyType
    [Documentation]  Validate response time for creating a policyType
    ValidateResponseTimeForApi  /policytypes  POST

ValidateResponseTimeDeletePolicy
    [Documentation]  Validate response time for deletion of policies
    ValidateResponseTimeForApi  /policies/{policyId}/versions/{policyVersion}  DELETE