Fix context paths in CSITs
THe context path for API and PAP is now configurable.
Issue-ID: POLICY-4482
Change-Id: If6b53c8163cc9f377005a665eca7cb6c146156af
Signed-off-by: liamfallon <liam.fallon@est.tech>
diff --git a/csit/api/tests/api-test.robot b/csit/api/tests/api-test.robot
index d9ca2a9..37a06e8 100644
--- a/csit/api/tests/api-test.robot
+++ b/csit/api/tests/api-test.robot
@@ -114,7 +114,7 @@
Metrics
[Documentation] Verify policy-api is exporting prometheus metrics
${auth}= PolicyAdminAuth
- ${resp}= GetMetrics ${POLICY_API_IP} ${auth}
+ ${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
diff --git a/csit/common-library.robot b/csit/common-library.robot
index 42d3ed1..95831b0 100644
--- a/csit/common-library.robot
+++ b/csit/common-library.robot
@@ -113,9 +113,9 @@
Should Be Equal As Strings ${responseEntry['state']} SUCCESS
GetMetrics
- [Arguments] ${hostname} ${auth}
+ [Arguments] ${hostname} ${auth} ${context_path}
Log Creating session http://${hostname}:6969
${session}= Create Session policy http://${hostname}:6969 auth=${auth}
- ${resp}= GET On Session policy /metrics expected_status=200
+ ${resp}= GET On Session policy ${context_path}metrics expected_status=200
Log Received response from policy ${resp.text}
[return] ${resp}
diff --git a/csit/config/pap/papParameters.yaml b/csit/config/pap/papParameters.yaml
index 330feee..cc59dda 100644
--- a/csit/config/pap/papParameters.yaml
+++ b/csit/config/pap/papParameters.yaml
@@ -23,6 +23,8 @@
server:
port: 6969
+ servlet:
+ context-path: /policy/pap/v1
ssl:
enabled: false
diff --git a/csit/pap/tests/pap-test.robot b/csit/pap/tests/pap-test.robot
index 8bf3230..624a415 100644
--- a/csit/pap/tests/pap-test.robot
+++ b/csit/pap/tests/pap-test.robot
@@ -41,12 +41,12 @@
Metrics
[Documentation] Verify policy pap is exporting prometheus metrics
${auth}= PolicyAdminAuth
- ${resp}= GetMetrics ${POLICY_PAP_IP} ${auth}
- Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/pap/v1/healthcheck",} 1.0
- Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/pap/v1/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
+ ${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",}
Statistics
[Documentation] Verify policy pap statistics
@@ -106,7 +106,7 @@
QueryPolicyAuditAfterUnDeploy
[Documentation] Verify policy audit record after undeploy
- Sleep 130 seconds
+ Sleep 20 seconds
QueryPolicyAudit /policy/pap/v1/policies/audit 200 testGroup pdpTypeA onap.restart.tca UNDEPLOYMENT
QueryPolicyAuditWithMetadataSetAfterUnDeploy