From 3f9a0960ae775678d1e1d4b598b593b59146cb0f Mon Sep 17 00:00:00 2001 From: pdragosh Date: Tue, 16 Apr 2019 13:19:45 -0400 Subject: Finish drools CSIT infra Basic health check for now. Need to have ci-management jobs enabled for this to work on every merge. Cleaning out unused scripts and mock server. Renaming policy engine script so its obvious that is what it is for. Issue-ID: POLICY-1651 Change-Id: I469823795d4a9f5531d150610ba2ed0b75585677 Signed-off-by: pdragosh Signed-off-by: Pamela Dragosh Signed-off-by: pdragosh Signed-off-by: jhh --- scripts/policy/config/drools/base.conf | 119 ++++++++++++ .../policy/config/drools/feature-healthcheck.conf | 18 ++ scripts/policy/docker-compose-drools-apps.yml | 47 +++++ scripts/policy/docker-compose-drools.yml | 55 ++++++ scripts/policy/docker-compose-engine.yml | 75 ++++++++ scripts/policy/engine.sh | 208 +++++++++++++++++++++ scripts/policy/mock-hello.sh | 31 --- scripts/policy/script1.sh | 208 --------------------- 8 files changed, 522 insertions(+), 239 deletions(-) create mode 100644 scripts/policy/config/drools/base.conf create mode 100644 scripts/policy/config/drools/feature-healthcheck.conf create mode 100644 scripts/policy/docker-compose-drools-apps.yml create mode 100644 scripts/policy/docker-compose-drools.yml create mode 100644 scripts/policy/docker-compose-engine.yml create mode 100755 scripts/policy/engine.sh delete mode 100755 scripts/policy/mock-hello.sh delete mode 100755 scripts/policy/script1.sh (limited to 'scripts/policy') diff --git a/scripts/policy/config/drools/base.conf b/scripts/policy/config/drools/base.conf new file mode 100644 index 00000000..d3164cb5 --- /dev/null +++ b/scripts/policy/config/drools/base.conf @@ -0,0 +1,119 @@ +# ============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. +# ============LICENSE_END========================================================= + +# JVM options + +JVM_OPTIONS=-server -Xms512m -Xmx512m + +# SYSTEM software configuration + +POLICY_HOME=/opt/app/policy +POLICY_LOGS=/var/log/onap/policy/pdpd +JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk +KEYSTORE_PASSWD=Pol1cy_0nap +TRUSTSTORE_PASSWD=Pol1cy_0nap + +# Telemetry credentials + +TELEMETRY_PORT=9696 +TELEMETRY_HOST=0.0.0.0 +TELEMETRY_USER=demo@people.osaaf.org +TELEMETRY_PASSWORD=demo123456! + +# nexus repository + +SNAPSHOT_REPOSITORY_ID= +SNAPSHOT_REPOSITORY_URL= +RELEASE_REPOSITORY_ID= +RELEASE_REPOSITORY_URL= +REPOSITORY_USERNAME= +REPOSITORY_PASSWORD= + +# Relational (SQL) DB access + +SQL_HOST= +SQL_USER= +SQL_PASSWORD= + +# AAF + +AAF=false +AAF_NAMESPACE=org.onap.policy +AAF_HOST=aaf.api.simpledemo.onap.org + +# PDP-D DMaaP configuration channel + +PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION +PDPD_CONFIGURATION_API_KEY= +PDPD_CONFIGURATION_API_SECRET= +PDPD_CONFIGURATION_CONSUMER_GROUP= +PDPD_CONFIGURATION_CONSUMER_INSTANCE= +PDPD_CONFIGURATION_PARTITION_KEY= + +# PAP-PDP configuration channel + +POLICY_PDP_PAP_TOPIC=POLICY-PDP-PAP +POLICY_PDP_PAP_API_KEY= +POLICY_PDP_PAP_API_SECRET= + +# PAP + +PAP_HOST=pap +PAP_USERNAME=testpap +PAP_PASSWORD=alpha123 + +# PDP-X + +PDP_HOST=pdp +PDP_USERNAME=testpdp +PDP_PASSWORD=alpha123 +PDP_CLIENT_USERNAME=python +PDP_CLIENT_PASSWORD=test +PDP_ENVIRONMENT=TEST + +# DCAE DMaaP + +DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT +DCAE_SERVERS=mr.api.simpledemo.onap.org +DCAE_CONSUMER_GROUP=dcae.policy.shared + +# Open DMaaP + +DMAAP_SERVERS=mr.api.simpledemo.onap.org + +# AAI + +AAI_URL=https://aai.api.simpledemo.onap.org:8443 +AAI_USERNAME=policy@policy.onap.org +AAI_PASSWORD=demo123456! + +# MSO + +SO_URL=http://vm1.mso.simpledemo.onap.org:8080/onap/so/infra +SO_USERNAME=InfraPortalClient +SO_PASSWORD=password1$ + +# VFC + +VFC_URL= +VFC_USERNAME= +VFC_PASSWORD= + +# SDNC + +SDNC_URL= +SDNC_USERNAME= +SDNC_PASSWORD= diff --git a/scripts/policy/config/drools/feature-healthcheck.conf b/scripts/policy/config/drools/feature-healthcheck.conf new file mode 100644 index 00000000..c205e9f7 --- /dev/null +++ b/scripts/policy/config/drools/feature-healthcheck.conf @@ -0,0 +1,18 @@ +# ============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. +# ============LICENSE_END========================================================= + +HEALTHCHECK_USER=demo@people.osaaf.org +HEALTHCHECK_PASSWORD=demo123456! diff --git a/scripts/policy/docker-compose-drools-apps.yml b/scripts/policy/docker-compose-drools-apps.yml new file mode 100644 index 00000000..a42c2996 --- /dev/null +++ b/scripts/policy/docker-compose-drools-apps.yml @@ -0,0 +1,47 @@ +# Copyright 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. +version: '2' +services: + mariadb: + image: mariadb:10.2.14 + container_name: mariadb + hostname: mariadb + command: ['--lower-case-table-names=1', '--wait_timeout=28800'] + env_file: + - ${WORKSPACE}/scripts/policy/config/db/db.conf + volumes: + - ${WORKSPACE}/scripts/policy/config/db:/docker-entrypoint-initdb.d + expose: + - 3306 + drools: + image: nexus3.onap.org:10001/onap/policy-pdpd-cl:1.4-SNAPSHOT-latest + container_name: drools + depends_on: + - mariadb + hostname: drools + expose: + - 6969 + - 9696 + volumes: + - ${WORKSPACE}/scripts/policy/config/drools:/tmp/policy-install/config + environment: + - DEBUG=y + start_dependencies: + image: dadarek/wait-for-dependencies + container_name: policy-wait + depends_on: + - mariadb + hostname: policy-wait + command: mariadb:3306 + diff --git a/scripts/policy/docker-compose-drools.yml b/scripts/policy/docker-compose-drools.yml new file mode 100644 index 00000000..ffee9cdc --- /dev/null +++ b/scripts/policy/docker-compose-drools.yml @@ -0,0 +1,55 @@ +# Copyright 2018 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. +version: '2' +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 + expose: + - 3306 + nexus: + image: sonatype/nexus:2.14.8-01 + container_name: nexus + hostname: nexus + pap: + image: onap/policy-pe + environment: + - PRELOAD_POLICIES=${PRELOAD_POLICIES} + container_name: pap + depends_on: + - mariadb + hostname: pap + expose: + - 8443 + - 9091 + command: pap + volumes: + - ./config/pe:/tmp/policy-install/config + drools: + image: onap/policy-drools + container_name: drools + depends_on: + - mariadb + - nexus + hostname: drools + expose: + - 6969 + - 9696 + volumes: + - ./config/drools:/tmp/policy-install/config diff --git a/scripts/policy/docker-compose-engine.yml b/scripts/policy/docker-compose-engine.yml new file mode 100644 index 00000000..e67729e2 --- /dev/null +++ b/scripts/policy/docker-compose-engine.yml @@ -0,0 +1,75 @@ +# Copyright 2018 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. +version: '2' +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 + expose: + - 3306 + nexus: + image: sonatype/nexus:2.14.8-01 + container_name: nexus + hostname: nexus + pap: + image: onap/policy-pe + environment: + - PRELOAD_POLICIES=${PRELOAD_POLICIES} + container_name: pap + depends_on: + - mariadb + hostname: pap + expose: + - 8443 + - 9091 + command: pap + volumes: + - ./config/pe:/tmp/policy-install/config + pdp: + image: onap/policy-pe + container_name: pdp + depends_on: + - pap + hostname: pdp + expose: + - 8081 + command: pdp + volumes: + - ./config/pe:/tmp/policy-install/config + brmsgw: + image: onap/policy-pe + container_name: brmsgw + depends_on: + - pap + hostname: brmsgw + command: brmsgw + volumes: + - ./config/pe:/tmp/policy-install/config + drools: + image: onap/policy-drools + container_name: drools + depends_on: + - mariadb + - nexus + hostname: drools + expose: + - 6969 + - 9696 + volumes: + - ./config/drools:/tmp/policy-install/config diff --git a/scripts/policy/engine.sh b/scripts/policy/engine.sh new file mode 100755 index 00000000..b806cec5 --- /dev/null +++ b/scripts/policy/engine.sh @@ -0,0 +1,208 @@ +#!/bin/bash +# +# Copyright 2017-2018 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. +# +echo "This is ${WORKSPACE}/scripts/policy/engine.sh" + + +# the directory of the script +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +echo ${DIR} + +# the temp directory used, within $DIR +# omit the -p parameter to create a temporal directory in the default location +WORK_DIR=`mktemp -d -p "$DIR"` +echo ${WORK_DIR} + +cd ${WORK_DIR} + +# check if tmp dir was created +if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then + echo "Could not create temp dir" + exit 1 +fi + +# bring down maven +mkdir maven +cd maven +curl -O http://apache.claz.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz +tar -xzvf apache-maven-3.3.9-bin.tar.gz +ls -l +export PATH=${PATH}:${WORK_DIR}/maven/apache-maven-3.3.9/bin +${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn -v +cd .. + +ifconfig + +export IP=`ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}'` +if [ -z "$IP" ]; then + echo "Could not determine IP address" + exit 1 +fi +echo $IP + +if ! ifconfig docker0; then + export DOCKER_IP="$IP" +else + export DOCKER_IP=`ifconfig docker0 | awk -F: '/inet addr/ {gsub(/ .*/,"",$2); print $2}'` +fi +echo $DOCKER_IP + +git clone http://gerrit.onap.org/r/oparent + +git clone http://gerrit.onap.org/r/policy/engine +cd engine/packages/docker +${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn prepare-package --settings ${WORK_DIR}/oparent/settings.xml +docker build -t onap/policy-pe target/policy-pe + +cd ${WORK_DIR} +git clone http://gerrit.onap.org/r/policy/drools-pdp +cd drools-pdp/packages/docker +${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn prepare-package --settings ${WORK_DIR}/oparent/settings.xml +docker build -t onap/policy-drools target/policy-drools + +cd ${WORK_DIR} +git clone http://gerrit.onap.org/r/policy/docker +cd docker + +chmod +x config/drools/drools-tweaks.sh + +echo $IP > config/pe/ip_addr.txt +ls -l config/pe/ip_addr.txt +cat config/pe/ip_addr.txt + +export MTU=9126 + +export PRELOAD_POLICIES=false +docker-compose -f docker-compose-integration.yml up -d + +if [ ! $? -eq 0 ]; then + echo "Docker compose failed" + exit 1 +fi + +docker ps + +POLICY_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' drools` +echo ${POLICY_IP} + +PDP_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' pdp` +echo ${PDP_IP} + +PAP_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' pap` +echo ${PAP_IP} + +BRMS_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' brmsgw` +echo ${BRMS_IP} + +NEXUS_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' nexus` +echo ${NEXUS_IP} + +MARIADB_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' mariadb` +echo ${MARIADB_IP} + +sleep 3m + +docker logs mariadb 2>&1 | grep -q "mysqld: ready for connections" +if [ $? -eq 0 ]; then + # mariadb is ok - sleep a little longer for others + sleep 2m + +else + echo mariadb is not ready + echo Restarting... + + docker kill drools pdp pap brmsgw nexus mariadb + docker rm -f drools pdp pap brmsgw nexus mariadb + + docker-compose -f docker-compose-integration.yml up -d + + if [ ! $? -eq 0 ]; then + echo "Docker compose failed" + exit 1 + fi + + docker ps + + POLICY_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' drools` + echo ${POLICY_IP} + + PDP_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' pdp` + echo ${PDP_IP} + + PAP_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' pap` + echo ${PAP_IP} + + BRMS_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' brmsgw` + echo ${BRMS_IP} + + NEXUS_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' nexus` + echo ${NEXUS_IP} + + MARIADB_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' mariadb` + echo ${MARIADB_IP} + + sleep 5m +fi + +netstat -tnl + +docker logs mariadb +${DIR}/wait_for_port.sh ${MARIADB_IP} 3306 + +docker logs pap +${DIR}/wait_for_port.sh ${PAP_IP} 9091 + +docker logs pdp +${DIR}/wait_for_port.sh ${PDP_IP} 8081 + +docker logs brmsgw +${DIR}/wait_for_port.sh ${BRMS_IP} 9989 + +docker logs nexus +${DIR}/wait_for_port.sh ${NEXUS_IP} 8081 + +docker logs drools +${DIR}/wait_for_port.sh ${POLICY_IP} 6969 + +TIME_OUT=600 +INTERVAL=20 +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + curl -k -i --user "demo@people.osaaf.org:demo123456!" -H "ContentType: application/json" -H "Accept: application/json" https://${POLICY_IP}:6969/healthcheck && break + + echo Sleep: $INTERVAL seconds before testing if Policy is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) + +done + +TIME_OUT=600 +INTERVAL=20 +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + + curl -k -i -v -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -d '{"policyName": ".*"}' https://${PDP_IP}:8081/pdp/api/getConfig && break + +echo Sleep: $INTERVAL seconds before testing if Policy is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) + +done + +# +# Add more sleep for everything to settle +# +sleep 3m diff --git a/scripts/policy/mock-hello.sh b/scripts/policy/mock-hello.sh deleted file mode 100755 index 6092dcba..00000000 --- a/scripts/policy/mock-hello.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# Copyright 2017 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. -# -# $1 ip address of the mock server - -curl -v -X PUT -d @- http://$1:1080/expectation < config/pe/ip_addr.txt -ls -l config/pe/ip_addr.txt -cat config/pe/ip_addr.txt - -export MTU=9126 - -export PRELOAD_POLICIES=false -docker-compose -f docker-compose-integration.yml up -d - -if [ ! $? -eq 0 ]; then - echo "Docker compose failed" - exit 1 -fi - -docker ps - -POLICY_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' drools` -echo ${POLICY_IP} - -PDP_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' pdp` -echo ${PDP_IP} - -PAP_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' pap` -echo ${PAP_IP} - -BRMS_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' brmsgw` -echo ${BRMS_IP} - -NEXUS_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' nexus` -echo ${NEXUS_IP} - -MARIADB_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' mariadb` -echo ${MARIADB_IP} - -sleep 3m - -docker logs mariadb 2>&1 | grep -q "mysqld: ready for connections" -if [ $? -eq 0 ]; then - # mariadb is ok - sleep a little longer for others - sleep 2m - -else - echo mariadb is not ready - echo Restarting... - - docker kill drools pdp pap brmsgw nexus mariadb - docker rm -f drools pdp pap brmsgw nexus mariadb - - docker-compose -f docker-compose-integration.yml up -d - - if [ ! $? -eq 0 ]; then - echo "Docker compose failed" - exit 1 - fi - - docker ps - - POLICY_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' drools` - echo ${POLICY_IP} - - PDP_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' pdp` - echo ${PDP_IP} - - PAP_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' pap` - echo ${PAP_IP} - - BRMS_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' brmsgw` - echo ${BRMS_IP} - - NEXUS_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' nexus` - echo ${NEXUS_IP} - - MARIADB_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' mariadb` - echo ${MARIADB_IP} - - sleep 5m -fi - -netstat -tnl - -docker logs mariadb -${DIR}/wait_for_port.sh ${MARIADB_IP} 3306 - -docker logs pap -${DIR}/wait_for_port.sh ${PAP_IP} 9091 - -docker logs pdp -${DIR}/wait_for_port.sh ${PDP_IP} 8081 - -docker logs brmsgw -${DIR}/wait_for_port.sh ${BRMS_IP} 9989 - -docker logs nexus -${DIR}/wait_for_port.sh ${NEXUS_IP} 8081 - -docker logs drools -${DIR}/wait_for_port.sh ${POLICY_IP} 6969 - -TIME_OUT=600 -INTERVAL=20 -TIME=0 -while [ "$TIME" -lt "$TIME_OUT" ]; do - curl -k -i --user "demo@people.osaaf.org:demo123456!" -H "ContentType: application/json" -H "Accept: application/json" https://${POLICY_IP}:6969/healthcheck && break - - echo Sleep: $INTERVAL seconds before testing if Policy is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds - sleep $INTERVAL - TIME=$(($TIME+$INTERVAL)) - -done - -TIME_OUT=600 -INTERVAL=20 -TIME=0 -while [ "$TIME" -lt "$TIME_OUT" ]; do - - curl -k -i -v -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -d '{"policyName": ".*"}' https://${PDP_IP}:8081/pdp/api/getConfig && break - -echo Sleep: $INTERVAL seconds before testing if Policy is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds - sleep $INTERVAL - TIME=$(($TIME+$INTERVAL)) - -done - -# -# Add more sleep for everything to settle -# -sleep 3m -- cgit 1.2.3-korg