aboutsummaryrefslogtreecommitdiffstats
path: root/csit/api
diff options
context:
space:
mode:
authorPrakhar Pandey <prakhar.pandey@bell.ca>2022-03-25 15:46:19 -0400
committerPrakhar Pandey <prakhar.pandey@bell.ca>2022-03-25 15:50:21 -0400
commit3a34857fa082055ba25659f4d1e53d61472f860c (patch)
tree60b231504cbec0edd593f7fbf218a6d37db281c6 /csit/api
parenta8be1f7e70ea46dfd82fa74595a43df88c2497e0 (diff)
Add CSIT Test cases for api metrics
Adding csit test cases for application level metrics exposed by api component. Issue-ID: POLICY-3966 Signed-off-by: Prakhar Pandey <prakhar.pandey@bell.ca> Change-Id: Iccaa1c8e55ddc5b9961371c85aa41a5371ada560
Diffstat (limited to 'csit/api')
-rw-r--r--csit/api/tests/api-test.robot30
1 files changed, 24 insertions, 6 deletions
diff --git a/csit/api/tests/api-test.robot b/csit/api/tests/api-test.robot
index c5c7e860..4eb48888 100644
--- a/csit/api/tests/api-test.robot
+++ b/csit/api/tests/api-test.robot
@@ -11,12 +11,8 @@ Healthcheck
[Documentation] Verify policy api health check
${resp}= GetReq /policy/api/v1/healthcheck
Should Be Equal As Strings ${resp.json()['code']} 200
-
-Metrics
- [Documentation] Verify policy-api is exporting prometheus metrics
- ${auth}= PolicyAdminAuth
- ${resp}= GetMetrics ${POLICY_API_IP} ${auth}
- Should Contain ${resp.text} jvm_threads_live_threads
+ Should Be Equal As Strings ${resp.json()['healthy']} True
+ Should Be Equal As Strings ${resp.json()['message']} alive
Statistics
[Documentation] Verify policy api statistics
@@ -106,6 +102,28 @@ DeleteSpecificPolicyTypeV2
DeleteReq /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 200
DeleteReq /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 404
+Metrics
+ [Documentation] Verify policy-api is exporting prometheus metrics
+ ${auth}= PolicyAdminAuth
+ ${resp}= GetMetrics ${POLICY_API_IP} ${auth}
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/healthcheck",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/statistics",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/policies",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/policies/{policyId}/versions/{policyVersion}",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="POST",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="POST",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policy/api/v1/policies/{policyId}/versions/{policyVersion}",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes/{policyTypeId}/versions/{versionId}",} 2.0
+ Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/{policyVersion}",} 1.0
+ Should Contain ${resp.text} http_server_requests_seconds_sum
+ Should Contain ${resp.text} http_server_requests_seconds_max
+ Should Contain ${resp.text} spring_data_repository_invocations_seconds_count
+ Should Contain ${resp.text} spring_data_repository_invocations_seconds_sum
+ Should Contain ${resp.text} spring_data_repository_invocations_seconds_max
+ Should Contain ${resp.text} jvm_threads_live_threads
+
*** Keywords ***
GetReq