diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2023-02-09 11:56:27 +0000 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2023-02-14 15:52:04 +0000 |
commit | 9fc9fa480d5b18b0988b9388d13db8328032fc52 (patch) | |
tree | 4d851a64d6593335e7c02a5267875833a04e9591 /csit/pap/tests | |
parent | f5a11b0b346df610ffa8d9857956abf113ce6765 (diff) |
Add SLAs validations to docker csit robot tests
Issue-ID: POLICY-4529
Change-Id: I197a51892e9135d20c2e8a49ce7787df3bfbd4fa
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'csit/pap/tests')
-rw-r--r-- | csit/pap/tests/pap-slas.robot | 60 | ||||
-rw-r--r-- | csit/pap/tests/pap-test.robot | 25 |
2 files changed, 85 insertions, 0 deletions
diff --git a/csit/pap/tests/pap-slas.robot b/csit/pap/tests/pap-slas.robot new file mode 100644 index 00000000..045530ae --- /dev/null +++ b/csit/pap/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] Sleep time to 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 diff --git a/csit/pap/tests/pap-test.robot b/csit/pap/tests/pap-test.robot index c417a83f..a4f0853d 100644 --- a/csit/pap/tests/pap-test.robot +++ b/csit/pap/tests/pap-test.robot @@ -12,6 +12,18 @@ GetReq ${resp}= PerformGetRequest ${POLICY_PAP_PORT} ${url} 200 null ${auth} [return] ${resp} +ValidateResponseTimeForPap + [Arguments] ${uri} ${method} + [Documentation] Check if uri response is under the required time for pap metrics + ValidateResponseTime pap-metrics ${uri} ${method} 500 + +ValidateDeploymentTime + [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} + *** Test Cases *** LoadPolicy [Documentation] Create a policy named 'onap.restart.tca' and version '1.0.0' using specific api @@ -126,3 +138,16 @@ DeletePdpGroups QueryPdpGroupsAfterDelete [Documentation] Verify PdpGroups after delete QueryPdpGroups 1 defaultGroup ACTIVE 0 null null null + +# ValidateSlaForPap +# [Documentation] Run checks against Prometheus server to check response time +# Sleep 30s +# ValidateDeploymentTime +# ValidateResponseTime pap-metrics /components/healthcheck GET 10000 +# ValidateResponseTimeForPap /healthcheck GET +# ValidateResponseTimeForPap /statistics GET +# ValidateResponseTimeForPap /policies/audit GET +# ValidateResponseTimeForPap /pdps/groups/{name} PUT +# ValidateResponseTimeForPap /pdps/policies/{name} DELETE +# ValidateResponseTimeForPap /pdps/groups/{name} DELETE +# ValidateResponseTimeForPap /pdps/groups/batch POST |