diff options
author | a.sreekumar <ajith.sreekumar@est.tech> | 2019-05-07 13:36:39 +0000 |
---|---|---|
committer | Bilal A <bilal@research.att.com> | 2019-05-31 21:19:49 +0000 |
commit | e74fd95261e37e4258d6ed325368069ba25eaa45 (patch) | |
tree | 6fc79a18f6484986159f680cf53ece1e143e22ef /scripts | |
parent | 7a86895fa2911ccdc5b827a1e1c2c2d54343d4f5 (diff) |
Adding end to end CSIT test cases for PDP-A
1) Adding test case to do health check of PDP-A.
2) Adding test case for end to end testing - create policy type and
policy using Policy API, deploy policy using PAP API and then execute
policy in APEX engine.
Change-Id: I97b208f4d7c319f993515719795d022ddfc429fa
Issue-ID: POLICY-1739
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
(cherry picked from commit 7d80c38635b4cf7ec0d517a95c63772c4c9aface)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/apex-pdp/OnapPfConfig.json | 17 | ||||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/apex-pdp/topic.properties | 23 | ||||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/db/db.conf | 16 | ||||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/db/db.sh | 22 | ||||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/pap/defaultConfig.json | 30 | ||||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/pap/logback.xml | 102 | ||||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/pap/s3pConfig.json | 11 | ||||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/pap/ssl/policy-keystore | bin | 0 -> 4407 bytes | |||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/pap/ssl/policy-truststore | bin | 0 -> 124176 bytes | |||
-rw-r--r-- | scripts/policy/policy-apex-pdp/config/pap/topic.properties | 23 | ||||
-rw-r--r-- | scripts/policy/policy-apex-pdp/docker-compose-apex.yml | 74 |
11 files changed, 318 insertions, 0 deletions
diff --git a/scripts/policy/policy-apex-pdp/config/apex-pdp/OnapPfConfig.json b/scripts/policy/policy-apex-pdp/config/apex-pdp/OnapPfConfig.json new file mode 100644 index 00000000..6944c9bd --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/apex-pdp/OnapPfConfig.json @@ -0,0 +1,17 @@ +{ + "name":"OnapPfParameterGroup", + "restServerParameters": { + "host": "0.0.0.0", + "port": 6969, + "userName": "healthcheck", + "password": "zb!XztG34", + "https": true, + "aaf": false + }, + "pdpStatusParameters":{ + "timeIntervalMs": 10000, + "pdpType":"apex", + "description":"Pdp Heartbeat", + "supportedPolicyTypes":[{"name":"onap.policies.controlloop.operational.Apex","version":"1.0.0"}] + } +} diff --git a/scripts/policy/policy-apex-pdp/config/apex-pdp/topic.properties b/scripts/policy/policy-apex-pdp/config/apex-pdp/topic.properties new file mode 100644 index 00000000..b7df11a8 --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/apex-pdp/topic.properties @@ -0,0 +1,23 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2019 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +dmaap.source.topics=POLICY-PDP-PAP +dmaap.sink.topics=POLICY-PDP-PAP + +dmaap.source.topics.POLICY-PDP-PAP.servers= dmaap:3904 +dmaap.sink.topics.POLICY-PDP-PAP.servers= dmaap:3904 diff --git a/scripts/policy/policy-apex-pdp/config/db/db.conf b/scripts/policy/policy-apex-pdp/config/db/db.conf new file mode 100644 index 00000000..4768bfc4 --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/db/db.conf @@ -0,0 +1,16 @@ +# Copyright (C) 2019 Nordix Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +MYSQL_ROOT_PASSWORD=secret +MYSQL_USER=policy_user +MYSQL_PASSWORD=policy_user diff --git a/scripts/policy/policy-apex-pdp/config/db/db.sh b/scripts/policy/policy-apex-pdp/config/db/db.sh new file mode 100644 index 00000000..660f2c5a --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/db/db.sh @@ -0,0 +1,22 @@ +#!/bin/bash -xv +# Copyright (C) 2019 Nordix Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +for db in policyadmin +do + mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};" + mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;" +done + +mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;" diff --git a/scripts/policy/policy-apex-pdp/config/pap/defaultConfig.json b/scripts/policy/policy-apex-pdp/config/pap/defaultConfig.json new file mode 100644 index 00000000..32b6c30f --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/pap/defaultConfig.json @@ -0,0 +1,30 @@ +{ + "name": "PapGroup", + "restServerParameters": { + "host": "0.0.0.0", + "port": 6969, + "userName": "healthcheck", + "password": "zb!XztG34", + "https": true, + "aaf": false + }, + "pdpParameters": { + "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": "cG9saWN5X3VzZXI=", + "persistenceUnit": "PolicyMariaDb" + } +} diff --git a/scripts/policy/policy-apex-pdp/config/pap/logback.xml b/scripts/policy/policy-apex-pdp/config/pap/logback.xml new file mode 100644 index 00000000..a34956c5 --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/pap/logback.xml @@ -0,0 +1,102 @@ +<!-- + ============LICENSE_START======================================================= + Copyright (C) 2019 Nordix Foundation. + Modifications Copyright (C) 2019 AT&T Intellectual Property. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + SPDX-License-Identifier: Apache-2.0 + ============LICENSE_END========================================================= +--> + +<configuration scan="true" scanPeriod="30 seconds" debug="false"> + + <property name="logDir" value="${POLICY_LOGS}" /> + + <property name="errorLog" value="error" /> + <property name="debugLog" value="debug" /> + <property name="networkLog" value="network" /> + + <property name="debugPattern" + value="[%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%level|%logger{0}|%thread] %msg%n" /> + <property name="errorPattern" value="${debugPattern}" /> + <property name="networkPattern" value="[%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%t]%m%n" /> + + <appender name="ErrorOut" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDir}/${errorLog}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${logDir}/${errorLog}.%d{yyyy-MM-dd}.%i.log.zip + </fileNamePattern> + <maxFileSize>50MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>10GB</totalSizeCap> + </rollingPolicy> + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>WARN</level> + </filter> + <encoder> + <pattern>${errorPattern}</pattern> + </encoder> + </appender> + + <appender name="AsyncErrorOut" class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="ErrorOut" /> + </appender> + + <appender name="DebugOut" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDir}/${debugLog}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${logDir}/${debugLog}.%d{yyyy-MM-dd}.%i.log.zip + </fileNamePattern> + <maxFileSize>50MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>10GB</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${debugPattern}</pattern> + </encoder> + </appender> + + <appender name="AsyncDebugOut" class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="DebugOut" /> + </appender> + + <appender name="NetworkOut" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDir}/${networkLog}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${logDir}/${networkLog}.%d{yyyy-MM-dd}.%i.log.zip + </fileNamePattern> + <maxFileSize>50MB</maxFileSize> + <maxHistory>30</maxHistory> + <totalSizeCap>10GB</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${networkPattern}</pattern> + </encoder> + </appender> + + <appender name="AsyncNetworkOut" class="ch.qos.logback.classic.AsyncAppender"> + <appender-ref ref="NetworkOut" /> + </appender> + + <logger name="network" level="INFO" additivity="false"> + <appender-ref ref="AsyncNetworkOut" /> + </logger> + + <logger name="org.eclipse.jetty.server.RequestLog" level="info" additivity="false"> + <appender-ref ref="AsyncNetworkOut" /> + </logger> + + <root level="INFO"> + <appender-ref ref="AsyncDebugOut" /> + <appender-ref ref="AsyncErrorOut" /> + </root> + +</configuration> diff --git a/scripts/policy/policy-apex-pdp/config/pap/s3pConfig.json b/scripts/policy/policy-apex-pdp/config/pap/s3pConfig.json new file mode 100644 index 00000000..3085f45d --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/pap/s3pConfig.json @@ -0,0 +1,11 @@ +{ + "name": "PapGroup", + "restServerParameters": { + "host": "0.0.0.0", + "port": 6969, + "userName": "healthcheck", + "password": "zb!XztG34", + "https": true, + "aaf": false + } +} diff --git a/scripts/policy/policy-apex-pdp/config/pap/ssl/policy-keystore b/scripts/policy/policy-apex-pdp/config/pap/ssl/policy-keystore Binary files differnew file mode 100644 index 00000000..bf876b8a --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/pap/ssl/policy-keystore diff --git a/scripts/policy/policy-apex-pdp/config/pap/ssl/policy-truststore b/scripts/policy/policy-apex-pdp/config/pap/ssl/policy-truststore Binary files differnew file mode 100644 index 00000000..b7d52ad1 --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/pap/ssl/policy-truststore diff --git a/scripts/policy/policy-apex-pdp/config/pap/topic.properties b/scripts/policy/policy-apex-pdp/config/pap/topic.properties new file mode 100644 index 00000000..b7df11a8 --- /dev/null +++ b/scripts/policy/policy-apex-pdp/config/pap/topic.properties @@ -0,0 +1,23 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2019 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +dmaap.source.topics=POLICY-PDP-PAP +dmaap.sink.topics=POLICY-PDP-PAP + +dmaap.source.topics.POLICY-PDP-PAP.servers= dmaap:3904 +dmaap.sink.topics.POLICY-PDP-PAP.servers= dmaap:3904 diff --git a/scripts/policy/policy-apex-pdp/docker-compose-apex.yml b/scripts/policy/policy-apex-pdp/docker-compose-apex.yml new file mode 100644 index 00000000..9039b894 --- /dev/null +++ b/scripts/policy/policy-apex-pdp/docker-compose-apex.yml @@ -0,0 +1,74 @@ +# Copyright (C) 2019 Nordix Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +version: '2' +networks: + default: + driver: bridge +services: + mariadb: + image: mariadb:10.2.14 + container_name: mariadb + hostname: mariadb + command: ['--lower-case-table-names=1', '--wait_timeout=28800'] + env_file: config/db/db.conf + volumes: + - ./config/db:/docker-entrypoint-initdb.d + ports: + - "3306:3306" + dmaap: + image: dmaap/simulator + container_name: dmaap-simulator + hostname: dmaap-simulator + ports: + - "3904:3904" + pap: + image: nexus3.onap.org:10001/onap/policy-pap:2.0.0-SNAPSHOT-latest + container_name: policy-pap + depends_on: + - mariadb + - dmaap + hostname: policy-pap + volumes: + - ./config/pap/:/opt/app/policy/pap/etc/ + api: + image: nexus3.onap.org:10001/onap/policy-api + container_name: policy-api + depends_on: + - mariadb + hostname: policy-api + apex: + image: nexus3.onap.org:10001/onap/policy-apex-pdp:2.1-SNAPSHOT-latest + container_name: policy-apex-pdp + depends_on: + - mariadb + - dmaap + - pap + - api + hostname: policy-apex-pdp + command: ['/opt/app/policy/apex-pdp/bin/apexOnapPf.sh', '-c', '/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json', '-p', '/opt/app/policy/apex-pdp/etc/onappf/config/topic.properties'] + volumes: + - ./config/apex-pdp/:/opt/app/policy/apex-pdp/etc/onappf/config/ + ports: + - "6969:6969" + - "23324:23324" + start_dependencies: + image: dadarek/wait-for-dependencies + container_name: policy-wait + depends_on: + - mariadb + - dmaap + hostname: policy-wait + command: + - mariadb:3306 + - dmaap:3904 |