diff options
author | liamfallon <liam.fallon@est.tech> | 2023-01-23 09:52:24 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2023-01-23 14:57:49 +0000 |
commit | 0132d7a9ea3ad03ed0350a7d89694420a4d8221c (patch) | |
tree | db6fa25bab405dc0f84bb1866324c770d3cf90ee | |
parent | c49f64d146fc89c47aeedfc5f99993785d33e80f (diff) |
Make API context path configurable in CSITs
Issue-ID: POLICY-4143
Change-Id: I17010b16b03a002130b5a8d619f561c9deab19c8
Signed-off-by: liamfallon <liam.fallon@est.tech>
-rw-r--r-- | csit/api/tests/api-test.robot | 24 | ||||
-rw-r--r-- | csit/config/api/apiParameters.yaml | 2 | ||||
-rw-r--r-- | csit/pap/tests/pap-test.robot | 10 |
3 files changed, 19 insertions, 17 deletions
diff --git a/csit/api/tests/api-test.robot b/csit/api/tests/api-test.robot index 37a06e85..c6927326 100644 --- a/csit/api/tests/api-test.robot +++ b/csit/api/tests/api-test.robot @@ -114,18 +114,18 @@ DeleteSpecificPolicyTypeV3 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}",} 3.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 + ${resp}= GetMetrics ${POLICY_API_IP} ${auth} /policy/api/v1/ + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/statistics",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policytypes",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policies",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policies/{policyId}/versions/{policyVersion}",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/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="/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="/policytypes",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policies/{policyId}/versions/{policyVersion}",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{versionId}",} 3.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/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 diff --git a/csit/config/api/apiParameters.yaml b/csit/config/api/apiParameters.yaml index 61f88df6..36d53915 100644 --- a/csit/config/api/apiParameters.yaml +++ b/csit/config/api/apiParameters.yaml @@ -2,6 +2,8 @@ server: port: 6969 ssl: enabled: false + servlet: + context-path: /policy/api/v1 spring: security.user: diff --git a/csit/pap/tests/pap-test.robot b/csit/pap/tests/pap-test.robot index 624a4150..e79f6ede 100644 --- a/csit/pap/tests/pap-test.robot +++ b/csit/pap/tests/pap-test.robot @@ -42,11 +42,11 @@ Metrics [Documentation] Verify policy pap is exporting prometheus metrics ${auth}= PolicyAdminAuth ${resp}= GetMetrics ${POLICY_PAP_IP} ${auth} /policy/pap/v1/ - Should Contain ${resp.text} tomcat_sessions_active_current_sessions - Should Contain ${resp.text} jdbc_connections_idle{name="dataSource",} - Should Contain ${resp.text} spring_data_repository_invocations_seconds_count{exception="None",method="save",repository="PdpGroupRepository",state="SUCCESS",} - Should Contain ${resp.text} spring_data_repository_invocations_seconds_count{exception="None",method="findByKeyName",repository="PdpGroupRepository",state="SUCCESS",} - Should Contain ${resp.text} spring_data_repository_invocations_seconds_count{exception="None",method="findAll",repository="PolicyStatusRepository",state="SUCCESS",} + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/components/healthcheck",} 1.0 + Should Contain ${resp.text} spring_data_repository_invocations_seconds_count{exception="None",method="save",repository="PdpGroupRepository",state="SUCCESS",} 1.0 + Should Contain ${resp.text} spring_data_repository_invocations_seconds_count{exception="None",method="findByKeyName",repository="PdpGroupRepository",state="SUCCESS",} 1.0 + Should Contain ${resp.text} spring_data_repository_invocations_seconds_count{exception="None",method="findAll",repository="PolicyStatusRepository",state="SUCCESS",} 1.0 Statistics [Documentation] Verify policy pap statistics |