From 794b0c933f409a8cdba8216072103a2abf7207fe Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Fri, 10 Dec 2021 17:17:20 +0000 Subject: PAP CSIT changes for spring boot migration Change-Id: I0b0df4769240e4ca1512b6c2acba25d59734ffe3 Issue-ID: POLICY-3754 Signed-off-by: a.sreekumar --- csit/config/pap/defaultConfig.json | 70 ----------------------------------- csit/config/pap/papParameters.yaml | 76 ++++++++++++++++++++++++++++++++++++++ csit/docker-compose-all.yml | 2 +- csit/pap/tests/pap-test.robot | 8 +++- 4 files changed, 83 insertions(+), 73 deletions(-) delete mode 100644 csit/config/pap/defaultConfig.json create mode 100644 csit/config/pap/papParameters.yaml diff --git a/csit/config/pap/defaultConfig.json b/csit/config/pap/defaultConfig.json deleted file mode 100644 index 28595321..00000000 --- a/csit/config/pap/defaultConfig.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "PapGroup", - "restServerParameters": { - "host": "0.0.0.0", - "port": 6969, - "userName": "policyadmin", - "password": "zb!XztG34", - "https": true, - "aaf": false, - "prometheus": true - }, - "pdpParameters": { - "heartBeatMs": 20000, - "updateParameters": { - "maxRetryCount": 1, - "maxWaitMs": 30000 - }, - "stateChangeParameters": { - "maxRetryCount": 1, - "maxWaitMs": 30000 - } - }, - "databaseProviderParameters": { - "name": "PolicyProviderParameterGroup", - "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl", - "databaseDriver": "org.mariadb.jdbc.Driver", - "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin", - "databaseUser": "policy_user", - "databasePassword": "policy_user", - "persistenceUnit": "PolicyMariaDb" - }, - "savePdpStatisticsInDb": true, - "topicParameterGroup": { - "topicSources" : [{ - "topic" : "POLICY-PDP-PAP", - "servers" : [ "message-router" ], - "topicCommInfrastructure" : "dmaap", - "useHttps": true - }, - { - "topic" : "POLICY-HEARTBEAT", - "effectiveTopic": "POLICY-PDP-PAP", - "consumerGroup": "policy-pap", - "servers" : [ "message-router" ], - "topicCommInfrastructure" : "dmaap", - "useHttps": true - }], - "topicSinks" : [{ - "topic" : "POLICY-PDP-PAP", - "servers" : [ "message-router" ], - "topicCommInfrastructure" : "dmaap", - "useHttps": true - }, - { - "topic" : "POLICY-NOTIFICATION", - "servers" : [ "message-router" ], - "topicCommInfrastructure" : "dmaap", - "useHttps": true - }] - }, - "healthCheckRestClientParameters":[{ - "clientName": "api", - "hostname": "policy-api", - "port": 6969, - "userName": "policyadmin", - "password": "zb!XztG34", - "useHttps": true, - "basePath": "policy/api/v1/healthcheck" - }] -} diff --git a/csit/config/pap/papParameters.yaml b/csit/config/pap/papParameters.yaml new file mode 100644 index 00000000..fe28bf21 --- /dev/null +++ b/csit/config/pap/papParameters.yaml @@ -0,0 +1,76 @@ +spring: + security: + user: + name: policyadmin + password: zb!XztG34 + http: + converters: + preferred-json-mapper: gson + +server: + port: 6969 + ssl: + enabled: true + +pap: + name: PapGroup + pdpParameters: + heartBeatMs: 120000 + updateParameters: + maxRetryCount: 1 + maxWaitMs: 30000 + stateChangeParameters: + maxRetryCount: 1 + maxWaitMs: 30000 + databaseProviderParameters: + name: PolicyProviderParameterGroup + implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl + databaseDriver: org.mariadb.jdbc.Driver + databaseUrl: jdbc:mariadb://mariadb:3306/policyadmin + databaseUser: policy_user + databasePassword: policy_user + persistenceUnit: PolicyMariaDb + savePdpStatisticsInDb: true + topicParameterGroup: + topicSources: + - topic: POLICY-PDP-PAP + servers: + - message-router + topicCommInfrastructure: dmaap + useHttps: true + fetchTimeout: 15000 + - topic: POLICY-HEARTBEAT + effectiveTopic: POLICY-PDP-PAP + consumerGroup: policy-pap + servers: + - message-router + topicCommInfrastructure: dmaap + useHttps: true + fetchTimeout: 15000 + topicSinks: + - topic: POLICY-PDP-PAP + servers: + - message-router + topicCommInfrastructure: dmaap + useHttps: true + - topic: POLICY-NOTIFICATION + servers: + - message-router + topicCommInfrastructure: dmaap + useHttps: true + healthCheckRestClientParameters: + - clientName: api + hostname: policy-api + port: 6969 + userName: policyadmin + password: zb!XztG34 + useHttps: true + basePath: policy/api/v1/healthcheck + +management: + endpoints: + web: + base-path: / + exposure: + include: health, metrics, prometheus + path-mapping.prometheus: metrics diff --git a/csit/docker-compose-all.yml b/csit/docker-compose-all.yml index bad05932..7c289e14 100644 --- a/csit/docker-compose-all.yml +++ b/csit/docker-compose-all.yml @@ -103,7 +103,7 @@ services: expose: - 6969 volumes: - - ./config/pap/defaultConfig.json:/opt/app/policy/pap/etc/defaultConfig.json:ro + - ./config/pap/papParameters.yaml:/opt/app/policy/pap/etc/papParameters.yaml:ro - ./config/pap/groups.json:/opt/app/policy/pap/etc/mounted/groups.json:ro - ./config/ks.jks:/opt/app/policy/pap/etc/ssl/policy-keystore:ro - ./config/policy-truststore:/opt/app/policy/pap/etc/ssl/policy-truststore:ro diff --git a/csit/pap/tests/pap-test.robot b/csit/pap/tests/pap-test.robot index 9fb7e61f..d9713013 100644 --- a/csit/pap/tests/pap-test.robot +++ b/csit/pap/tests/pap-test.robot @@ -30,8 +30,12 @@ Consolidated Healthcheck Metrics [Documentation] Verify policy pap is exporting prometheus metrics - ${resp}= GetReq /metrics - Should Contain ${resp.text} jvm_threads_current + Log Creating session https://${POLICY_PAP_IP}:6969 + ${policyadmin}= Create list policyadmin zb!XztG34 + ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${policyadmin} + ${resp}= GET On Session policy url=/metrics expected_status=200 + Log Received response from policy ${resp.text} + Should Contain ${resp.text} jvm_threads_live_threads Statistics [Documentation] Verify policy pap statistics -- cgit 1.2.3-korg