diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2023-02-17 15:14:07 +0000 |
---|---|---|
committer | Adheli Tavares <adheli.tavares@est.tech> | 2023-02-22 13:22:48 +0000 |
commit | 1f339f886d01c6d6ac5cfd6467850c61fee4f675 (patch) | |
tree | 9c59715170d07c951421f5cf8f4d7d939e289c8b /csit/resources/tests/pap-slas.robot | |
parent | a6664dc5c767210a78f140b9fa149c2a8261b428 (diff) |
Restructure of csit files to be used both by docker and k8s config
Issue-ID: POLICY-4125
Change-Id: Id63b3badb1b451b36e3226970dcafaa5a62d860f
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'csit/resources/tests/pap-slas.robot')
-rw-r--r-- | csit/resources/tests/pap-slas.robot | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/csit/resources/tests/pap-slas.robot b/csit/resources/tests/pap-slas.robot new file mode 100644 index 00000000..1fa19627 --- /dev/null +++ b/csit/resources/tests/pap-slas.robot @@ -0,0 +1,60 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Resource ${CURDIR}/common-library.robot + +*** Keywords *** +ValidateResponseTimeForPap + [Arguments] ${uri} ${method} + [Documentation] Check if uri response is under the 500ms required time for pap metrics + ValidateResponseTime pap-metrics ${uri} ${method} 500 + +*** Test Cases *** +WaitForPrometheusServer + [Documentation] Wait for Prometheus server to gather all metrics + Sleep 1 minute + +ValidateResponseTimeForHealthcheck + [Documentation] Validate component healthcheck response time + ValidateResponseTimeForPap /healthcheck GET + +ValidateResponseTimeForSystemHealthcheck + [Documentation] Validate if system healthcheck response time is under 1000ms + ValidateResponseTime pap-metrics /components/healthcheck GET 10000 + +ValidateResponseTimeForStatistics + [Documentation] Validate statistics response time + ValidateResponseTimeForPap /statistics GET + +# TODO: includes notification, so always over 500ms +# ValidateResponseTimeCreateGroup +# [Documentation] Validate create group response time +# ValidateResponseTimeForPap /pdps/groups/batch POST + +ValidateResponseTimeQueryPolicyAudit + [Documentation] Validate query audits response time + ValidateResponseTimeForPap /policies/audit GET + +ValidateResponseTimeUpdateGroup + [Documentation] Validate pdps/group response time + ValidateResponseTimeForPap /pdps/groups/{name} PUT + +ValidatePolicyDeploymentTime + [Documentation] Check if deployment of policy is under 2000ms + ${resp}= QueryPrometheus pap_policy_deployments_seconds_sum{operation="deploy",status="SUCCESS"}/pap_policy_deployments_seconds_count{operation="deploy",status="SUCCESS"} + ${rawNumber}= Evaluate ${resp['data']['result'][0]['value'][1]} + ${actualTime}= Set Variable ${rawNumber * ${1000}} + Should Be True ${actualTime} <= ${2000} + +ValidateResponseTimeDeletePolicy + [Documentation] Check if undeployment of policy is under 2000ms + ${resp}= QueryPrometheus pap_policy_deployments_seconds_sum{operation="undeploy",status="SUCCESS"}/pap_policy_deployments_seconds_count{operation="undeploy",status="SUCCESS"} + ${rawNumber}= Evaluate ${resp['data']['result'][0]['value'][1]} + ${actualTime}= Set Variable ${rawNumber * ${1000}} + Should Be True ${actualTime} <= ${2000} + +ValidateResponseTimeDeleteGroup + [Documentation] Validate delete group response time + ValidateResponseTimeForPap /pdps/groups/{name} DELETE |