diff options
Diffstat (limited to 'scripts')
20 files changed, 493 insertions, 188 deletions
diff --git a/scripts/optf-cmso/cmso/start_cmso_containers.sh b/scripts/optf-cmso/cmso/start_cmso_containers.sh deleted file mode 100644 index ded86d7c..00000000 --- a/scripts/optf-cmso/cmso/start_cmso_containers.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# ------------------------------------------------------------------------- -# Copyright (c) 2018 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. -# -# ------------------------------------------------------------------------- -# - -echo "This is ${WORKSPACE}/scripts/opft-cmso/cmso/start_cmso_containers.sh" - -DB_IMAGE_VERSION=1.0-SNAPSHOT-latest -SERVICE_IMAGE_VERSION=1.0-SNAPSHOT-latest - -# start cmso mariadb and db-init containers with docker compose and configuration from cmso/cmso-service/extra/docker/cmso-service/docker-compose.yml - -docker run -p 3306:3306 --name cmso-mariadb -v $(pwd)/mariadb/conf1:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=beer -d mariadb:10.1.11 - -CMSO_DB_IP=`get-instance-ip.sh cmso-mariadb` - -${WORKSPACE}/scripts/optf-osdf/osdf/wait_for_port.sh ${CMSO_DB_IP} 3306 - -sed -i -e "s%192.168.56.101:3306%${CMSO_DB_IP}:3306%g" ./etc/config/cmso.properties -sed -i -e "s%192.168.56.101:3306%${CMSO_DB_IP}:3306%g" ./etc/config/liquibase.properties - - -docker run --name cmso-db-init -v $(pwd)/etc:/share/etc -v $(pwd)/logs:/share/logs \ - -d nexus3.onap.org:10001/onap/optf-cmso-dbinit:${DB_IMAGE_VERSION} - -sleep 30 - -docker run --name cmso-service -p 8080:8080 -v $(pwd)/etc:/share/etc -v $(pwd)/logs:/share/logs\ - -v $(pwd)/debug-logs:/share/debug-logs -d nexus3.onap.org:10001/onap/optf-cmso-service:${SERVICE_IMAGE_VERSION} - -CMSO_SERVICE_IP=`get-instance-ip.sh cmso-service` - -${WORKSPACE}/scripts/optf-osdf/osdf/wait_for_port.sh ${CMSO_SERVICE_IP} 8080 - - -ROBOT_VARIABLES="-v GLOBAL_SCHEDULER_HOST:${CMSO_SERVICE_IP}" - -echo ${ROBOT_VARIABLES}
\ No newline at end of file diff --git a/scripts/optf-cmso/cmso/wait_for_port.sh b/scripts/optf-cmso/cmso/wait_for_port.sh deleted file mode 100755 index 360fc210..00000000 --- a/scripts/optf-cmso/cmso/wait_for_port.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# ------------------------------------------------------------------------- -# Copyright (c) 2018 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. -# -# ------------------------------------------------------------------------- -# - -if [[ $# -ne 2 ]]; then - echo "Usage: wait-for-port hostname port" >&2 - exit 1 -fi - -host=$1 -port=$2 - -echo "Waiting for $host port $port open" -until telnet $host $port </dev/null 2>/dev/null | grep -q '^Connected'; do - sleep 1 -done - -echo "$host port $port is open" - -exit 0 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 diff --git a/scripts/policy/policy-xacml-pdp/config/db/db.conf b/scripts/policy/policy-xacml-pdp/config/db/db.conf new file mode 100644 index 00000000..b4449118 --- /dev/null +++ b/scripts/policy/policy-xacml-pdp/config/db/db.conf @@ -0,0 +1,20 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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========================================================= +MYSQL_ROOT_PASSWORD=secret +MYSQL_USER=policy_user +MYSQL_PASSWORD=policy_user
\ No newline at end of file diff --git a/scripts/policy/policy-xacml-pdp/config/db/db.sh b/scripts/policy/policy-xacml-pdp/config/db/db.sh new file mode 100644 index 00000000..ac150a03 --- /dev/null +++ b/scripts/policy/policy-xacml-pdp/config/db/db.sh @@ -0,0 +1,26 @@ +#!/bin/bash -xv +# ============LICENSE_START======================================================= +# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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========================================================= + +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;"
\ No newline at end of file diff --git a/scripts/policy/policy-xacml-pdp/docker-compose-pdpx.yml b/scripts/policy/policy-xacml-pdp/docker-compose-pdpx.yml new file mode 100644 index 00000000..62e0ce21 --- /dev/null +++ b/scripts/policy/policy-xacml-pdp/docker-compose-pdpx.yml @@ -0,0 +1,72 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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========================================================= +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" + message-router: + 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 + - message-router + hostname: policy-pap + api: + image: nexus3.onap.org:10001/onap/policy-api + container_name: policy-api + depends_on: + - mariadb + hostname: policy-api + xacml-pdp: + image: nexus3.onap.org:10001/onap/policy-xacml-pdp:2.0.0-SNAPSHOT-latest + container_name: policy-xacml-pdp + depends_on: + - mariadb + - message-router + - pap + - api + hostname: policy-xacml-pdp + ports: + - "6969:6969" + start_dependencies: + image: dadarek/wait-for-dependencies + container_name: policy-wait + depends_on: + - mariadb + - message-router + hostname: policy-wait + command: + - mariadb:3306 + - message-router:3904 diff --git a/scripts/sdc/docker_health.sh b/scripts/sdc/docker_health.sh index 4264b1a5..30efd39f 100644 --- a/scripts/sdc/docker_health.sh +++ b/scripts/sdc/docker_health.sh @@ -2,22 +2,21 @@ curl localhost:9200/_cluster/health?pretty=true -echo "BE health-Check:" +echo "BE Health Check:" curl http://localhost:8080/sdc2/rest/healthCheck echo "" echo "" -echo "FE health-Check:" +echo "FE Health Check:" curl http://localhost:8181/sdc1/rest/healthCheck - echo "" echo "" http_code=$(curl -o out.html -w '%{http_code}' -H "Accept: application/json" -H "Content-Type: application/json" -H "USER_ID: jh0003" http://localhost:8080/sdc2/rest/v1/user/demo;) if [[ ${http_code} != 200 ]] then - echo "Error [${http_code}] while user existance check" + echo "Error [${http_code}] while checking existence of user" return ${http_code} fi -echo "check user existance: OK" +echo "Check user existence: OK" diff --git a/scripts/sdc/kill_dcae_containers.sh b/scripts/sdc/kill_dcae_containers.sh new file mode 100644 index 00000000..5e11372d --- /dev/null +++ b/scripts/sdc/kill_dcae_containers.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# Copyright 2019 © Samsung Electronics Co., Ltd. +# +# 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. +# + +# +# Note! This is only temporary solution for killing SDC DCAE plugin's +# docker containers that must be currently used whenever docker_run.sh is used +# with -dcae option - See SDC-2338 for related image naming issue +# +# DCAE plugin-related parts will also have to be refactored under dedicated +# directories in the future +# + +echo "This is ${WORKSPACE}/scripts/sdc/kill_dcae_containers.sh" + +# kill and remove all sdc dcae dockers +docker stop $(docker ps -a -q --filter="name=dcae") +docker rm $(docker ps -a -q --filter="name=dcae") diff --git a/scripts/sdc/setup_sdc_for_apis_sanity.sh b/scripts/sdc/setup_sdc_for_sanity.sh index c1442d1f..79708c58 100644 --- a/scripts/sdc/setup_sdc_for_apis_sanity.sh +++ b/scripts/sdc/setup_sdc_for_sanity.sh @@ -1,10 +1,23 @@ #!/bin/bash +function usage { + echo "usage: setup_sdc_for_sanity.sh {tad|tud}" + echo "setup sdc and run api test suite: setup_sdc_for_sanity.sh tad" + echo "setup sdc and run ui test suite: setup_sdc_for_sanity.sh tud" +} + + set -x -echo "This is ${WORKSPACE}/scripts/sdc/clone_and_setup_sdc_data.sh" +echo "This is ${WORKSPACE}/scripts/sdc/setup_sdc_for_sanity.sh" + + +if [ "$1" != "tad" ] && [ "$1" != "tud" ]; then + usage + exit 1 +fi -# Clone sdc enviroment template +# Clone sdc enviroment template mkdir -p ${WORKSPACE}/data/environments/ mkdir -p ${WORKSPACE}/data/clone/ #mkdir -p ${WORKSPACE}/data/logs/BE/SDC/SDC-BE @@ -12,7 +25,6 @@ mkdir -p ${WORKSPACE}/data/clone/ #chmod -R 777 ${WORKSPACE}/data/logs #ls -lR ${WORKSPACE}/data/logs/ - cd ${WORKSPACE}/data/clone git clone --depth 1 http://gerrit.onap.org/r/sdc -b ${GERRIT_BRANCH} @@ -22,13 +34,14 @@ chmod -R 777 ${WORKSPACE}/data/clone export ENV_NAME='CSIT' export MR_IP_ADDR='10.0.0.1' +export TEST_SUITE=$1 ifconfig IP_ADDRESS=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'` export HOST_IP=$IP_ADDRESS # setup enviroment json - + cat ${WORKSPACE}/data/clone/sdc/sdc-os-chef/environments/Template.json | sed "s/yyy/"$IP_ADDRESS"/g" > ${WORKSPACE}/data/environments/$ENV_NAME.json sed -i "s/xxx/"$ENV_NAME"/g" ${WORKSPACE}/data/environments/$ENV_NAME.json sed -i "s/\"ueb_url_list\":.*/\"ueb_url_list\": \""$MR_IP_ADDR","$MR_IP_ADDR"\",/g" ${WORKSPACE}/data/environments/$ENV_NAME.json @@ -37,8 +50,8 @@ sed -i "s/\"fqdn\":.*/\"fqdn\": [\""$MR_IP_ADDR"\", \""$MR_IP_ADDR"\"]/g" ${WORK source ${WORKSPACE}/data/clone/sdc/version.properties export RELEASE=$major.$minor-STAGING-latest -export DEP_ENV=$ENV_NAME - +export DEP_ENV=$ENV_NAME + cp ${WORKSPACE}/data/clone/sdc/sdc-os-chef/scripts/docker_run.sh ${WORKSPACE}/scripts/sdc/ #sed -i "s~/data~${WORKSPACE}\/data~g" ${WORKSPACE}/scripts/sdc/docker_run.sh #sed -i "s/HOST_IP=\${IP}/HOST_IP=\${HOST_IP}/g" ${WORKSPACE}/scripts/sdc/docker_run.sh @@ -47,11 +60,11 @@ cp ${WORKSPACE}/data/clone/sdc/sdc-os-chef/scripts/docker_run.sh ${WORKSPACE}/sc source ${WORKSPACE}/data/clone/sdc/version.properties export RELEASE=$major.$minor-STAGING-latest -${WORKSPACE}/scripts/sdc/docker_run.sh -r ${RELEASE} -e ${ENV_NAME} -p 10001 -tad +${WORKSPACE}/scripts/sdc/docker_run.sh -r ${RELEASE} -e ${ENV_NAME} -p 10001 -${TEST_SUITE} sleep 120 -#monitor test processes +#monitor test processes TIME_OUT=1200 INTERVAL=20 @@ -77,7 +90,7 @@ done if [ "$TIME" -ge "$TIME_OUT" ] then - echo TIME OUT: Sany was NOT completed in $TIME_OUT seconds... Could cause problems for tests... + echo TIME OUT: SDC sanity was NOT completed in $TIME_OUT seconds... Could cause problems for tests... fi diff --git a/scripts/sdc/setup_sdc_for_ui_sanity.sh b/scripts/sdc/setup_sdc_for_ui_sanity.sh deleted file mode 100644 index 6f8a2328..00000000 --- a/scripts/sdc/setup_sdc_for_ui_sanity.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -set -x - -echo "This is ${WORKSPACE}/scripts/sdc/clone_and_setup_sdc_data.sh" - -# Clone sdc enviroment template -mkdir -p ${WORKSPACE}/data/environments/ -mkdir -p ${WORKSPACE}/data/clone/ -#mkdir -p ${WORKSPACE}/data/logs/BE/SDC/SDC-BE -#mkdir -p ${WORKSPACE}/data/logs/FE/SDC/SDC-FE -#chmod -R 777 ${WORKSPACE}/data/logs -#ls -lR ${WORKSPACE}/data/logs/ - - -cd ${WORKSPACE}/data/clone -git clone --depth 1 http://gerrit.onap.org/r/sdc -b ${GERRIT_BRANCH} - -chmod -R 777 ${WORKSPACE}/data/clone - -# set enviroment variables - -export ENV_NAME='CSIT' -export MR_IP_ADDR='10.0.0.1' - -ifconfig -IP_ADDRESS=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'` -export HOST_IP=$IP_ADDRESS - -# setup enviroment json - -cat ${WORKSPACE}/data/clone/sdc/sdc-os-chef/environments/Template.json | sed "s/yyy/"$IP_ADDRESS"/g" > ${WORKSPACE}/data/environments/$ENV_NAME.json -sed -i "s/xxx/"$ENV_NAME"/g" ${WORKSPACE}/data/environments/$ENV_NAME.json -sed -i "s/\"ueb_url_list\":.*/\"ueb_url_list\": \""$MR_IP_ADDR","$MR_IP_ADDR"\",/g" ${WORKSPACE}/data/environments/$ENV_NAME.json -sed -i "s/\"fqdn\":.*/\"fqdn\": [\""$MR_IP_ADDR"\", \""$MR_IP_ADDR"\"]/g" ${WORKSPACE}/data/environments/$ENV_NAME.json - - -source ${WORKSPACE}/data/clone/sdc/version.properties -export RELEASE=$major.$minor-STAGING-latest -export DEP_ENV=$ENV_NAME - -cp ${WORKSPACE}/data/clone/sdc/sdc-os-chef/scripts/docker_run.sh ${WORKSPACE}/scripts/sdc/ -#sed -i "s~/data~${WORKSPACE}\/data~g" ${WORKSPACE}/scripts/sdc/docker_run.sh -#sed -i "s/HOST_IP=\${IP}/HOST_IP=\${HOST_IP}/g" ${WORKSPACE}/scripts/sdc/docker_run.sh -#sed -i "s/ENVNAME=\"\${DEP_ENV}\"/ENVNAME=\"\${ENV_NAME}\"/g" ${WORKSPACE}/scripts/sdc/docker_run.sh - -source ${WORKSPACE}/data/clone/sdc/version.properties -export RELEASE=$major.$minor-STAGING-latest - -${WORKSPACE}/scripts/sdc/docker_run.sh -r ${RELEASE} -e ${ENV_NAME} -p 10001 -tud - -sleep 120 - -#monitor test processes - -TIME_OUT=1200 -INTERVAL=20 -TIME=0 -CID=`docker ps | grep tests | awk '{print $1}'` - -while [ "$TIME" -lt "$TIME_OUT" ]; do - -PID=`docker exec -i $CID ps -ef | grep java | awk '{print $1}'` - -echo sanity PID is -- $PID - -if [ -z "$PID" ] - then - echo SDC sanity finished in $TIME seconds - break - fi - - echo Sleep: $INTERVAL seconds before testing if SDC sanity completed. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds - sleep $INTERVAL - TIME=$(($TIME+$INTERVAL)) -done - -if [ "$TIME" -ge "$TIME_OUT" ] - then - echo TIME OUT: Sany was NOT completed in $TIME_OUT seconds... Could cause problems for tests... -fi - - - - |