From 2070574bb059eb665a3f00e7cba3c1a5380c5334 Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Fri, 14 Feb 2020 12:03:33 +0000 Subject: [PATCH] CSIT fixes for frankfurt breakage CSITs as per the latest policy type validation changes. Drools and drools apps fixes. Removed policy-health. Change-Id: I086bf747059435e12d15e0481b00c97c20eaadc1 Issue-ID: POLICY-1402 Signed-off-by: a.sreekumar Signed-off-by: jhh Signed-off-by: a.sreekumar --- plans/policy/drools-applications/setup.sh | 26 +- plans/policy/drools-applications/teardown.sh | 9 +- plans/policy/drools-pdp/setup.sh | 60 ++- plans/policy/drools-pdp/teardown.sh | 23 +- plans/policy/health/setup.sh | 34 -- plans/policy/health/testplan.txt | 3 - scripts/policy/config/db/db.sh | 2 +- .../config/drools-apps/custom/features.pre.sh | 19 + .../policy/config/drools-apps/custom/noop.pre.sh | 27 ++ .../drools-apps/custom/standalone-settings.xml | 57 +++ .../config/{drools => drools-apps/env}/base.conf | 8 +- .../env}/feature-healthcheck.conf | 2 +- .../drools-apps/env/feature-pooling-dmaap.conf | 17 + scripts/policy/config/drools/custom/noop.pre.sh | 22 + scripts/policy/config/drools/env/base.conf | 120 +++++ scripts/policy/config/pe/base.conf | 43 ++ scripts/policy/config/pe/brmsgw-tweaks.sh | 40 ++ scripts/policy/config/pe/brmsgw.conf | 67 +++ scripts/policy/config/pe/console.conf | 145 ++++++ scripts/policy/config/pe/elk.conf | 16 + .../policy/config/pe/mysql.conf | 27 +- scripts/policy/config/pe/pap-tweaks.sh | 14 + scripts/policy/config/pe/pap.conf | 68 +++ scripts/policy/config/pe/paplp.conf | 25 + scripts/policy/config/pe/pdp-tweaks.sh | 14 + scripts/policy/config/pe/pdp.conf | 69 +++ scripts/policy/config/pe/pdplp.conf | 25 + scripts/policy/config/pe/push-policies.sh | 506 +++++++++++++++++++++ scripts/policy/docker-compose-drools-apps.yml | 18 +- scripts/policy/docker-compose-drools.yml | 40 +- scripts/policy/docker-compose-engine.yml | 29 +- scripts/policy/drools-pdp-script.sh | 246 ---------- scripts/policy/engine.sh | 264 ----------- .../csar/sample_csar_with_apex_policy.csar | Bin 97010 -> 96917 bytes ...onap.policies.controlloop.operational.Apex.json | 36 +- ...olicies.controlloop.operational.Apex.tosca.json | 1 - tests/policy/api/api-test.robot | 6 +- ...ap.policy.monitoring.cdap.tca.hi.lo.app.v1.json | 3 +- .../vCPE.policy.monitoring.input.tosca.v1_2.json | 52 +++ .../drools-applications-test.robot | 23 + tests/policy/drools-pdp/drools-pdp-test.robot | 4 +- tests/policy/engine/Policy-CSIT.robot | 425 ----------------- tests/policy/engine/__init__.robot | 2 - tests/policy/engine/configpolicy_vCPE_R1.jinja | 7 - tests/policy/engine/configpolicy_vDNS_R1.jinja | 7 - tests/policy/engine/configpolicy_vFW_R1.jinja | 7 - tests/policy/engine/createpolicy.jinja | 21 - tests/policy/engine/deletepolicy.jinja | 5 - tests/policy/engine/getconfigpolicy.jinja | 8 - tests/policy/engine/getoofpolicy.jinja | 6 - tests/policy/engine/global_properties.robot | 30 -- tests/policy/engine/listpolicy.jinja | 3 - tests/policy/engine/multiple_pushpolicy.jinja | 5 - tests/policy/engine/multiple_unpushpolicy.jinja | 6 - tests/policy/engine/oofpolicy_HPA_R1.jinja | 6 - tests/policy/engine/opspolicy_VDNS_R1.jinja | 16 - tests/policy/engine/opspolicy_VFW_R1.jinja | 16 - tests/policy/engine/opspolicy_vCPE_R1.jinja | 16 - tests/policy/engine/opspolicy_vOLTE_R1.jinja | 16 - tests/policy/engine/policy_interface.robot | 66 --- tests/policy/engine/pushpolicy.jinja | 5 - tests/policy/engine/sdncnamingpolicy_vFW.jinja | 11 - tests/policy/engine/sdncnamingpolicy_vPG.jinja | 11 - 63 files changed, 1498 insertions(+), 1407 deletions(-) delete mode 100755 plans/policy/health/setup.sh delete mode 100644 plans/policy/health/testplan.txt create mode 100755 scripts/policy/config/drools-apps/custom/features.pre.sh create mode 100755 scripts/policy/config/drools-apps/custom/noop.pre.sh create mode 100644 scripts/policy/config/drools-apps/custom/standalone-settings.xml rename scripts/policy/config/{drools => drools-apps/env}/base.conf (96%) rename scripts/policy/config/{drools => drools-apps/env}/feature-healthcheck.conf (93%) create mode 100644 scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf create mode 100755 scripts/policy/config/drools/custom/noop.pre.sh create mode 100644 scripts/policy/config/drools/env/base.conf create mode 100644 scripts/policy/config/pe/base.conf create mode 100755 scripts/policy/config/pe/brmsgw-tweaks.sh create mode 100644 scripts/policy/config/pe/brmsgw.conf create mode 100644 scripts/policy/config/pe/console.conf create mode 100644 scripts/policy/config/pe/elk.conf rename plans/policy/health/teardown.sh => scripts/policy/config/pe/mysql.conf (52%) mode change 100755 => 100644 create mode 100755 scripts/policy/config/pe/pap-tweaks.sh create mode 100644 scripts/policy/config/pe/pap.conf create mode 100644 scripts/policy/config/pe/paplp.conf create mode 100755 scripts/policy/config/pe/pdp-tweaks.sh create mode 100644 scripts/policy/config/pe/pdp.conf create mode 100644 scripts/policy/config/pe/pdplp.conf create mode 100755 scripts/policy/config/pe/push-policies.sh delete mode 100755 scripts/policy/drools-pdp-script.sh delete mode 100755 scripts/policy/engine.sh create mode 100644 tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json delete mode 100644 tests/policy/engine/Policy-CSIT.robot delete mode 100644 tests/policy/engine/__init__.robot delete mode 100644 tests/policy/engine/configpolicy_vCPE_R1.jinja delete mode 100644 tests/policy/engine/configpolicy_vDNS_R1.jinja delete mode 100644 tests/policy/engine/configpolicy_vFW_R1.jinja delete mode 100644 tests/policy/engine/createpolicy.jinja delete mode 100644 tests/policy/engine/deletepolicy.jinja delete mode 100644 tests/policy/engine/getconfigpolicy.jinja delete mode 100644 tests/policy/engine/getoofpolicy.jinja delete mode 100644 tests/policy/engine/global_properties.robot delete mode 100644 tests/policy/engine/listpolicy.jinja delete mode 100644 tests/policy/engine/multiple_pushpolicy.jinja delete mode 100644 tests/policy/engine/multiple_unpushpolicy.jinja delete mode 100644 tests/policy/engine/oofpolicy_HPA_R1.jinja delete mode 100644 tests/policy/engine/opspolicy_VDNS_R1.jinja delete mode 100644 tests/policy/engine/opspolicy_VFW_R1.jinja delete mode 100644 tests/policy/engine/opspolicy_vCPE_R1.jinja delete mode 100644 tests/policy/engine/opspolicy_vOLTE_R1.jinja delete mode 100644 tests/policy/engine/policy_interface.robot delete mode 100644 tests/policy/engine/pushpolicy.jinja delete mode 100644 tests/policy/engine/sdncnamingpolicy_vFW.jinja delete mode 100644 tests/policy/engine/sdncnamingpolicy_vPG.jinja diff --git a/plans/policy/drools-applications/setup.sh b/plans/policy/drools-applications/setup.sh index e550cdb0..c66c4929 100755 --- a/plans/policy/drools-applications/setup.sh +++ b/plans/policy/drools-applications/setup.sh @@ -1,6 +1,6 @@ #!/bin/bash # ============LICENSE_START======================================================= -# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2019-2020 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. @@ -16,6 +16,9 @@ # # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= + +# OS upgrades + source ${SCRIPTS}/policy/config/policy-csit.conf export POLICY_MARIADB_VER echo ${GERRIT_BRANCH} @@ -32,18 +35,15 @@ echo ${POLICY_DROOLS_APPS_VERSION_EXTRACT} export POLICY_DROOLS_APPS_VERSION="${POLICY_DROOLS_APPS_VERSION_EXTRACT:0:3}-SNAPSHOT-latest" echo ${POLICY_DROOLS_APPS_VERSION} -docker login -u docker -p docker nexus3.onap.org:10001 +echo "user information: $(id)" +echo "docker and docker-compose versions:" +docker -v && docker-compose -v -# Adding this waiting container to avoid race condition between api and mariadb containers. -docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools-apps.yml run --rm start_dependencies -docker logs mariadb docker container ls -a docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools-apps.yml up -d -sleep 1m +sleep 2m -docker logs mariadb -docker logs drools docker container ls -a POLICY_DROOLS_IP=`get-instance-ip.sh drools` @@ -52,17 +52,13 @@ MARIADB_IP=`get-instance-ip.sh mariadb` echo DROOLS IP IS ${POLICY_DROOLS_IP} echo MARIADB IP IS ${MARIADB_IP} -# Wait for initialization -for i in {1..10}; do - curl -sS ${MARIADB_IP}:3306 && break - echo sleep $i - sleep $i -done - for i in {1..10}; do curl -sS ${POLICY_DROOLS_IP}:6969 && break echo sleep $i sleep $i done +# to give enough time to the usecases controller to come up +sleep 2m + ROBOT_VARIABLES="-v POLICY_DROOLS_IP:${POLICY_DROOLS_IP}" diff --git a/plans/policy/drools-applications/teardown.sh b/plans/policy/drools-applications/teardown.sh index 48ab171d..886b1ea3 100755 --- a/plans/policy/drools-applications/teardown.sh +++ b/plans/policy/drools-applications/teardown.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2019 AT&T Intellectual Property. All rights reserved. +# Copyright 2020 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. @@ -14,5 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -kill-instance.sh drools -kill-instance.sh mariadb + +mkdir -p $WORKSPACE/archives/ + +docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools-apps.yml logs > $WORKSPACE/archives/docker-compose-drools-apps.log +docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools-apps.yml down -v diff --git a/plans/policy/drools-pdp/setup.sh b/plans/policy/drools-pdp/setup.sh index 4851cd7e..d50106ff 100755 --- a/plans/policy/drools-pdp/setup.sh +++ b/plans/policy/drools-pdp/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash -# -# Copyright 2017 AT&T Intellectual Property. All rights reserved. -# +# ============LICENSE_START======================================================= +# Copyright 2017-2020 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 @@ -14,21 +14,47 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Place the scripts in run order: -source ${SCRIPTS}/common_functions.sh +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +# OS upgrades + +echo "Uninstall docker-py and reinstall docker." +pip uninstall -y docker-py +pip uninstall -y docker +pip install -U docker==2.7.0 + +echo "user information: $(id)" +echo "docker information:" +docker -v && docker-compose -v && docker info + +# Component Versions + +source ${SCRIPTS}/policy/config/policy-csit.conf +export POLICY_MARIADB_VER +echo ${GERRIT_BRANCH} +echo ${POLICY_MARIADB_VER} + +sudo apt-get -y install libxml2-utils +POLICY_DROOLS_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/drools-applications/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)" +export POLICY_DROOLS_VERSION="${POLICY_DROOLS_VERSION_EXTRACT:0:3}-SNAPSHOT-latest" +echo ${POLICY_DROOLS_VERSION} + +docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools.yml up -d +sleep 2m + +docker container ls -a -docker login -u docker -p docker nexus3.onap.org:10001 -docker pull nexus3.onap.org:10001/onap/policy-common-alpine:1.4.0 -docker tag nexus3.onap.org:10001/onap/policy-common-alpine:1.4.0 onap/policy-common-alpine:1.4.0 +POLICY_DROOLS_IP=`get-instance-ip.sh drools` +MARIADB_IP=`get-instance-ip.sh mariadb` -source ${WORKSPACE}/scripts/policy/drools-pdp-script.sh +echo DROOLS IP IS ${POLICY_DROOLS_IP} +echo MARIADB IP IS ${MARIADB_IP} -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v IP:${IP} -v POLICY_IP:${POLICY_IP} -v PDP_IP:${PDP_IP} -v DOCKER_IP:${DOCKER_IP}" -export PDP_IP=${PDP_IP} -export POLICY_IP=${POLICY_IP} -export DOCKER_IP=${DOCKER_IP} +for i in {1..10}; do + curl -sS ${POLICY_DROOLS_IP}:9696 && break + echo sleep $i + sleep $i +done -#Get current IP of VM -HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}') -export HOST_IP=${HOST_IP} +ROBOT_VARIABLES="-v POLICY_DROOLS_IP:${POLICY_DROOLS_IP}" diff --git a/plans/policy/drools-pdp/teardown.sh b/plans/policy/drools-pdp/teardown.sh index 303ccff1..e08593d2 100755 --- a/plans/policy/drools-pdp/teardown.sh +++ b/plans/policy/drools-pdp/teardown.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2017 AT&T Intellectual Property. All rights reserved. +# Copyright 2017-2020 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. @@ -15,21 +15,6 @@ # limitations under the License. # -function kill_instance() { -local name=$1 -docker logs "${name}" >> "${WORKSPACE}"/archives/"${name}".log -docker kill "${name}" -docker rm -v "${name}" -} - -mkdir -p "${WORKSPACE}"/archives - -kill_instance drools -kill_instance pdp -kill_instance brmsgw -kill_instance pap -kill_instance nexus -kill_instance mariadb - -rm -fr "${WORK_DIR}" - +mkdir -p $WORKSPACE/archives/ +docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools.yml logs > $WORKSPACE/archives/docker-compose-drools.log +docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools.yml down -v diff --git a/plans/policy/health/setup.sh b/plans/policy/health/setup.sh deleted file mode 100755 index 1b1155d8..00000000 --- a/plans/policy/health/setup.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# Copyright 2017, 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. -# -# Place the scripts in run order: -source ${SCRIPTS}/common_functions.sh - -docker login -u docker -p docker nexus3.onap.org:10001 -docker pull nexus3.onap.org:10001/onap/policy-common-alpine:1.4.0 -docker tag nexus3.onap.org:10001/onap/policy-common-alpine:1.4.0 onap/policy-common-alpine:1.4.0 - -source ${WORKSPACE}/scripts/policy/engine.sh - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v IP:${IP} -v POLICY_IP:${POLICY_IP} -v PDP_IP:${PDP_IP} -v DOCKER_IP:${DOCKER_IP}" -export PDP_IP=${PDP_IP} -export POLICY_IP=${POLICY_IP} -export DOCKER_IP=${DOCKER_IP} - -#Get current IP of VM -HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}') -export HOST_IP=${HOST_IP} diff --git a/plans/policy/health/testplan.txt b/plans/policy/health/testplan.txt deleted file mode 100644 index 6bad34fc..00000000 --- a/plans/policy/health/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -policy/engine diff --git a/scripts/policy/config/db/db.sh b/scripts/policy/config/db/db.sh index 9ab2be2f..24b04003 100755 --- a/scripts/policy/config/db/db.sh +++ b/scripts/policy/config/db/db.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -for db in policyadmin +for db in support onap_sdk log migration operationshistory10 pooling policyadmin operationshistory 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}'@'%' ;" diff --git a/scripts/policy/config/drools-apps/custom/features.pre.sh b/scripts/policy/config/drools-apps/custom/features.pre.sh new file mode 100755 index 00000000..93d6c6b9 --- /dev/null +++ b/scripts/policy/config/drools-apps/custom/features.pre.sh @@ -0,0 +1,19 @@ +#!/bin/bash -x +# ============LICENSE_START======================================================= +# Copyright (C) 2020 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========================================================= + +features disable distributed-locking +features enable controlloop-utils diff --git a/scripts/policy/config/drools-apps/custom/noop.pre.sh b/scripts/policy/config/drools-apps/custom/noop.pre.sh new file mode 100755 index 00000000..d73c5e00 --- /dev/null +++ b/scripts/policy/config/drools-apps/custom/noop.pre.sh @@ -0,0 +1,27 @@ +#!/bin/bash -x +# ============LICENSE_START======================================================= +# Copyright (C) 2020 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========================================================= + +sed -i "s/^dmaap/noop/g" \ + ${POLICY_HOME}/config/amsterdam-controller.properties \ + ${POLICY_HOME}/config/engine.properties \ + ${POLICY_HOME}/config/feature-lifecycle.properties \ + ${POLICY_HOME}/config/usecases-controller.properties + +chmod 644 ${POLICY_HOME}/config/amsterdam-controller.properties \ + ${POLICY_HOME}/config/engine.properties \ + ${POLICY_HOME}/config/feature-lifecycle.properties \ + ${POLICY_HOME}/config/usecases-controller.properties diff --git a/scripts/policy/config/drools-apps/custom/standalone-settings.xml b/scripts/policy/config/drools-apps/custom/standalone-settings.xml new file mode 100644 index 00000000..ebd6dd2a --- /dev/null +++ b/scripts/policy/config/drools-apps/custom/standalone-settings.xml @@ -0,0 +1,57 @@ + + + + + + + true + + + + + policy-local + + + + file-repository + file:${user.home}/.m2/file-repository + + true + always + + + true + always + + + + + + + + + + policy-local + + + diff --git a/scripts/policy/config/drools/base.conf b/scripts/policy/config/drools-apps/env/base.conf similarity index 96% rename from scripts/policy/config/drools/base.conf rename to scripts/policy/config/drools-apps/env/base.conf index 1e57226a..d8d0f4ed 100644 --- a/scripts/policy/config/drools/base.conf +++ b/scripts/policy/config/drools-apps/env/base.conf @@ -20,6 +20,7 @@ JVM_OPTIONS=-server -Xms512m -Xmx512m # SYSTEM software configuration +DEBUG=y POLICY_HOME=/opt/app/policy POLICY_LOGS=/var/log/onap/policy/pdpd KEYSTORE_PASSWD=Pol1cy_0nap @@ -40,12 +41,13 @@ RELEASE_REPOSITORY_ID= RELEASE_REPOSITORY_URL= REPOSITORY_USERNAME= REPOSITORY_PASSWORD= +REPOSITORY_OFFLINE=true # Relational (SQL) DB access -SQL_HOST= -SQL_USER= -SQL_PASSWORD= +SQL_HOST=mariadb +SQL_USER=policy_user +SQL_PASSWORD=policy_user # AAF diff --git a/scripts/policy/config/drools/feature-healthcheck.conf b/scripts/policy/config/drools-apps/env/feature-healthcheck.conf similarity index 93% rename from scripts/policy/config/drools/feature-healthcheck.conf rename to scripts/policy/config/drools-apps/env/feature-healthcheck.conf index c205e9f7..1c710547 100644 --- a/scripts/policy/config/drools/feature-healthcheck.conf +++ b/scripts/policy/config/drools-apps/env/feature-healthcheck.conf @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2020 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. diff --git a/scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf b/scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf new file mode 100644 index 00000000..3808e3d9 --- /dev/null +++ b/scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf @@ -0,0 +1,17 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2020 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========================================================= + +POOLING_TOPIC=POOLING diff --git a/scripts/policy/config/drools/custom/noop.pre.sh b/scripts/policy/config/drools/custom/noop.pre.sh new file mode 100755 index 00000000..63bdc4cf --- /dev/null +++ b/scripts/policy/config/drools/custom/noop.pre.sh @@ -0,0 +1,22 @@ +#!/bin/bash -x +# ============LICENSE_START======================================================= +# Copyright (C) 2020 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========================================================= + +sed -i "s/^dmaap/noop/g" \ + ${POLICY_HOME}/config/engine.properties \ + ${POLICY_HOME}/config/feature-lifecycle.properties + +chmod 644 ${POLICY_HOME}/config/engine.properties ${POLICY_HOME}/config/feature-lifecycle.properties diff --git a/scripts/policy/config/drools/env/base.conf b/scripts/policy/config/drools/env/base.conf new file mode 100644 index 00000000..8fef8a28 --- /dev/null +++ b/scripts/policy/config/drools/env/base.conf @@ -0,0 +1,120 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2020 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 + +DEBUG=y +POLICY_HOME=/opt/app/policy +POLICY_LOGS=/var/log/onap/policy/pdpd +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=policy-nexus-snapshots +SNAPSHOT_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/snapshots/ +RELEASE_REPOSITORY_ID=policy-nexus-releases +RELEASE_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/releases/ +REPOSITORY_USERNAME=admin +REPOSITORY_PASSWORD=admin123 +REPOSITORY_OFFLINE=false + +# Relational (SQL) DB access + +SQL_HOST=mariadb +SQL_USER=policy_user +SQL_PASSWORD=policy_user + +# 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_USERNAME= +PAP_PASSWORD= + +# PDP-X + +PDP_HOST= +PDP_USERNAME= +PDP_PASSWORD= +PDP_CLIENT_USERNAME= +PDP_CLIENT_PASSWORD= +PDP_ENVIRONMENT= + +# DCAE DMaaP + +DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT +DCAE_SERVERS= +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/pe/base.conf b/scripts/policy/config/pe/base.conf new file mode 100644 index 00000000..851234f3 --- /dev/null +++ b/scripts/policy/config/pe/base.conf @@ -0,0 +1,43 @@ +# Copyright 2020 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. + +JAVA_HOME=/usr/local/openjdk-11 +POLICY_HOME=/opt/app/policy +POLICY_LOGS=/var/log/onap +KEYSTORE_PASSWD=Pol1cy_0nap +TRUSTSTORE_PASSWD=Pol1cy_0nap + +JDBC_DRIVER=org.mariadb.jdbc.Driver +JDBC_URL=jdbc:mariadb://mariadb:3306/onap_sdk?connectTimeout=30000&socketTimeout=60000&log=true&sessionVariables=max_statement_time=30 +JDBC_LOG_URL=jdbc:mariadb://mariadb:3306/log?connectTimeout=30000&socketTimeout=60000&log=true&sessionVariables=max_statement_time=30 +JDBC_USER=policy_user +JDBC_PASSWORD=policy_user + +site_name=site_1 +fp_monitor_interval=30 +failed_counter_threshold=3 +test_trans_interval=20 +write_fpc_interval=5 +max_fpc_update_interval=60 +test_via_jmx=false +jmx_fqdn= + +AAF_NAMESPACE=org.onap.policy +AAF_HOST=aaf.api.simpledemo.onap.org + +ENVIRONMENT=TEST + +#Micro Service Model Properties +policy_msOnapName= +policy_msPolicyName= diff --git a/scripts/policy/config/pe/brmsgw-tweaks.sh b/scripts/policy/config/pe/brmsgw-tweaks.sh new file mode 100755 index 00000000..f74730cc --- /dev/null +++ b/scripts/policy/config/pe/brmsgw-tweaks.sh @@ -0,0 +1,40 @@ +#! /bin/bash +# Copyright 2020 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. + +PROPS_BUILD="${POLICY_HOME}/etc/build.info" + +PROPS_RUNTIME="${POLICY_HOME}/servers/brmsgw/config.properties" +PROPS_INSTALL="${POLICY_HOME}/install/servers/brmsgw/config.properties" + + +if [ ! -f "${PROPS_BUILD}" ]; then + echo "error: version information does not exist: ${PROPS_BUILD}" + exit 1 +fi + +source "${POLICY_HOME}/etc/build.info" + +if [ -z "${version}" ]; then + echo "error: no version information present" + exit 1 +fi + +for CONFIG in ${PROPS_RUNTIME} ${PROPS_INSTALL}; do + if [ ! -f "${CONFIG}" ]; then + echo "warning: configuration does not exist: ${CONFIG}" + else + sed -i -e "s/brms.dependency.version=.*/brms.dependency.version=${version}/g" "${CONFIG}" + fi +done diff --git a/scripts/policy/config/pe/brmsgw.conf b/scripts/policy/config/pe/brmsgw.conf new file mode 100644 index 00000000..c2db9d12 --- /dev/null +++ b/scripts/policy/config/pe/brmsgw.conf @@ -0,0 +1,67 @@ +# Copyright 2020 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. +# BRMSpep component installation configuration parameters +BRMSGW_JMX_PORT=9989 + +COMPONENT_X_MX_MB=512 +COMPONENT_X_MS_MB=512 + +REST_PAP_URL=https://pap:9091/pap/ +REST_PDP_ID=https://pdp:8081/pdp/ + +PDP_HTTP_USER_ID=testpdp +PDP_HTTP_PASSWORD=alpha123 +PDP_PAP_PDP_HTTP_USER_ID=testpap +PDP_PAP_PDP_HTTP_PASSWORD=alpha123 + +M2_HOME=/usr/share/java/maven-3 +snapshotRepositoryID=policy-nexus-snapshots +snapshotRepositoryName=Snapshots +snapshotRepositoryURL=http://nexus:8081/nexus/content/repositories/snapshots +releaseRepositoryID=policy-nexus-releases +releaseRepositoryName=Releases +releaseRepositoryURL=http://nexus:8081/nexus/content/repositories/releases +repositoryUsername=admin +repositoryPassword=admin123 +UEB_URL=mr.api.simpledemo.onap.org +UEB_TOPIC=PDPD-CONFIGURATION +UEB_API_KEY= +UEB_API_SECRET= + +groupID=org.onap.policy-engine +artifactID=drlPDPGroup +AMSTERDAM_GROUP_ID=org.onap.policy-engine.drools.amsterdam +AMSTERDAM_ARTIFACT_ID=policy-amsterdam-rules + +# the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase +resource_name=brmsgw_1 +node_type=brms_gateway + +#Environment should be Set either DEV, TEST or PROD +ENVIRONMENT=TEST + +#Notification Properties... type can be either websocket, ueb, or dmaap +BRMS_NOTIFICATION_TYPE=websocket +BRMS_UEB_URL=mr.api.simpledemo.onap.org +BRMS_UEB_TOPIC=PDPD-CONFIGURATION +BRMS_UEB_DELAY= +BRMS_CLIENT_ID=python +BRMS_CLIENT_KEY=dGVzdA== +BRMS_UEB_API_KEY= +BRMS_UEB_API_SECRET= + +#Dependency.json file version +BRMS_DEPENDENCY_VERSION=1.5.1 +BRMS_MODELS_DEPENDENCY_VERSION=2.1.2 + diff --git a/scripts/policy/config/pe/console.conf b/scripts/policy/config/pe/console.conf new file mode 100644 index 00000000..ceaad638 --- /dev/null +++ b/scripts/policy/config/pe/console.conf @@ -0,0 +1,145 @@ +# Copyright 2020 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. +# configs component installation configuration parameters + +# tomcat specific parameters + +TOMCAT_JMX_PORT=9993 +TOMCAT_SHUTDOWN_PORT=8090 +SSL_HTTP_CONNECTOR_PORT=8443 +SSL_HTTP_CONNECTOR_REDIRECT_PORT=8443 +SSL_AJP_CONNECTOR_PORT=8383 +SSL_AJP_CONNECTOR_REDIRECT_PORT=8443 + +TOMCAT_X_MS_MB=2048 +TOMCAT_X_MX_MB=2048 + +# ------------------ console properties --------------------------- + +# +# Authorization Policy + +ROOT_POLICIES=admin +ADMIN_FILE=Policy-Admin.xml + + +# Set your domain here: + +REST_ADMIN_DOMAIN=com + +# +# Location where the GIT repository is located +# +REST_ADMIN_REPOSITORY=repository + +# +# Location where all the user workspaces are located. +# +REST_ADMIN_WORKSPACE=${{POLICY_HOME}}/servers/console/bin/workspace + +# +# These can be set so the Admin Console knows who is logged on. Ideally, you can run the console in a J2EE +# container and setup authentication as you please. Setting HttpSession attribute values will override these +# values set in the properties files. +# +# ((HttpServletRequest) request).getSession().setAttribute("xacml.rest.admin.user.name", "Homer"); +# +# The default policy: Policy-Admin.xml is extremely simple. +# +# You can test authorization within the Admin Console by changing the user id. +# There are 3 supported user ids: +# guest - Read only access +# editor - Read/Write access +# admin - Read/Write/Admin access +# +# An empty or null value for xacml.rest.admin.user.id results in no access to the application at all. +# +# This is for development/demonstration purposes only. A production environment should provide authentication which is +# outside the scope of this application. This application can be used to develop a XACML policy for user authorization +# within this application. +# + +REST_ADMIN_USER_NAME=Administrator +REST_ADMIN_USER_ID=super-admin + +# +# +# Property to declare the max time frame for logs. +# +LOG_TIMEFRAME=30 + +# Property to declare the number of visible rows for users in MicroService Policy +COLUMN_COUNT=3 + +# Dashboard refresh rate in miliseconds +REFRESH_RATE=40000 + +# +# URL location for the PAP servlet. +# + + +REST_PAP_URL=https://pap:9091/pap/ + +# +# Config/Action Properties location. +# + +REST_CONFIG_HOME=${{POLICY_HOME}}/servers/pap/webapps/Config/ +REST_ACTION_HOME=${{POLICY_HOME}}/servers/pap/webapps/Action/ +REST_CONFIG_URL=https://pap:9091/ +REST_CONFIG_WEBAPPS=${{POLICY_HOME}}/servers/pap/webapps/ + +# PAP account information +CONSOLE_PAP_HTTP_USER_ID=testpap +CONSOLE_PAP_HTTP_PASSWORD=alpha123 + + +node_type=pap_admin +resource_name=console_1 + +# The (optional) period of time in seconds between executions of the integrity audit. +# Value < 0 : Audit does not run (default value if property is not present = -1) +# Value = 0 : Audit runs continuously +# Value > 0 : The period of time in seconds between execution of the audit on a particular node +integrity_audit_period_seconds=-1 + +#Automatic Policy Distribution +automatic_push=false + +#Diff of policies for Firewall feature +FW_GETURL= +FW_AUTHOURL= +FW_PROXY= +FW_PORT= + +#SMTP Server Details for Java Mail +onap_smtp_host= +onap_smtp_port=25 +onap_smtp_userName= +onap_smtp_password= +onap_smtp_emailExtension= +onap_application_name= + +#-----------------------ONAP-PORTAL-Properties---------------------- + +ONAP_REDIRECT_URL=http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm +ONAP_REST_URL=http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/auxapi +ONAP_UEB_URL_LIST= +ONAP_PORTAL_INBOX_NAME= +ONAP_UEB_APP_KEY= +ONAP_UEB_APP_SECRET= +ONAP_UEB_APP_MAILBOX_NAME= +APP_DISPLAY_NAME=ONAP Policy +ONAP_SHARED_CONTEXT_REST_URL=http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/context diff --git a/scripts/policy/config/pe/elk.conf b/scripts/policy/config/pe/elk.conf new file mode 100644 index 00000000..a65fd17d --- /dev/null +++ b/scripts/policy/config/pe/elk.conf @@ -0,0 +1,16 @@ +# Copyright 2020 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. +# elasticsearch + +ELK_JMX_PORT=9995 \ No newline at end of file diff --git a/plans/policy/health/teardown.sh b/scripts/policy/config/pe/mysql.conf old mode 100755 new mode 100644 similarity index 52% rename from plans/policy/health/teardown.sh rename to scripts/policy/config/pe/mysql.conf index 303ccff1..0f6ee8c7 --- a/plans/policy/health/teardown.sh +++ b/scripts/policy/config/pe/mysql.conf @@ -1,35 +1,18 @@ -#!/bin/bash -# -# Copyright 2017 AT&T Intellectual Property. All rights reserved. +# Copyright 2020 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 +# 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. -# - -function kill_instance() { -local name=$1 -docker logs "${name}" >> "${WORKSPACE}"/archives/"${name}".log -docker kill "${name}" -docker rm -v "${name}" -} - -mkdir -p "${WORKSPACE}"/archives - -kill_instance drools -kill_instance pdp -kill_instance brmsgw -kill_instance pap -kill_instance nexus -kill_instance mariadb +# mysql scripts component installation configuration parameters -rm -fr "${WORK_DIR}" +# Path to mysql bin +MYSQL_BIN=/usr/local/mysql/bin diff --git a/scripts/policy/config/pe/pap-tweaks.sh b/scripts/policy/config/pe/pap-tweaks.sh new file mode 100755 index 00000000..87c6d21d --- /dev/null +++ b/scripts/policy/config/pe/pap-tweaks.sh @@ -0,0 +1,14 @@ +#! /bin/bash +# Copyright 2020 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. diff --git a/scripts/policy/config/pe/pap.conf b/scripts/policy/config/pe/pap.conf new file mode 100644 index 00000000..86f5a50c --- /dev/null +++ b/scripts/policy/config/pe/pap.conf @@ -0,0 +1,68 @@ +# Copyright 2020 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. +# pap component installation configuration parameters + +# tomcat specific parameters + +TOMCAT_JMX_PORT=9990 +TOMCAT_SHUTDOWN_PORT=9405 +SSL_HTTP_CONNECTOR_PORT=9091 +SSL_AJP_CONNECTOR_PORT=8380 +SSL_AJP_CONNECTOR_REDIRECT_PORT=8443 + +TOMCAT_X_MS_MB=512 +TOMCAT_X_MX_MB=512 + +# pap properties + +PAP_PDPS=${{POLICY_HOME}}/servers/pap/bin/pdps +PAP_URL=https://pap:9091/pap/ + +PAP_INITIATE_PDP=true +PAP_HEARTBEAT_INTERVAL=10000 +PAP_HEARTBEAT_TIMEOUT=10000 + +REST_ADMIN_DOMAIN=com +REST_ADMIN_REPOSITORY=repository +REST_ADMIN_WORKSPACE=workspace + +# PDP related properties + +PAP_PDP_URL=https://pdp:8081/pdp/ +PAP_PDP_HTTP_USER_ID=testpdp +PAP_PDP_HTTP_PASSWORD=alpha123 + +PAP_HTTP_USER_ID=testpap +PAP_HTTP_PASSWORD=alpha123 + +#new values added 10-21-2015 +PROP_PAP_TRANS_WAIT=500000 +PROP_PAP_TRANS_TIMEOUT=5000 +PROP_PAP_AUDIT_TIMEOUT=300000 +PROP_PAP_RUN_AUDIT_FLAG=true +PROP_PAP_AUDIT_FLAG=true + +PROP_PAP_INCOMINGNOTIFICATION_TRIES=4 + + +node_type=pap +resource_name=pap_1 +dependency_groups=paplp_1 +test_via_jmx=true + +# The (optional) period of time in seconds between executions of the integrity audit. +# Value < 0 : Audit does not run (default value if property is not present = -1) +# Value = 0 : Audit runs continuously +# Value > 0 : The period of time in seconds between execution of the audit on a particular node +integrity_audit_period_seconds=-1 diff --git a/scripts/policy/config/pe/paplp.conf b/scripts/policy/config/pe/paplp.conf new file mode 100644 index 00000000..647625cb --- /dev/null +++ b/scripts/policy/config/pe/paplp.conf @@ -0,0 +1,25 @@ +# Copyright 2020 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. +# JVM specific parameters +LOGPARSER_JMX_PORT=9996 +LOGPARSER_X_MS_MB=256 +LOGPARSER_X_MX_MB=256 + +SERVER=https://pap:9091/pap/ +LOGPATH=/var/log/onap/policy/pap/pap-rest.log +PARSERLOGPATH=${{POLICY_HOME}}/servers/paplp/bin/IntegrityMonitor.log + +node_type=logparser +# the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase +resource_name=paplp_1 diff --git a/scripts/policy/config/pe/pdp-tweaks.sh b/scripts/policy/config/pe/pdp-tweaks.sh new file mode 100755 index 00000000..87c6d21d --- /dev/null +++ b/scripts/policy/config/pe/pdp-tweaks.sh @@ -0,0 +1,14 @@ +#! /bin/bash +# Copyright 2020 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. diff --git a/scripts/policy/config/pe/pdp.conf b/scripts/policy/config/pe/pdp.conf new file mode 100644 index 00000000..0aa6b0b6 --- /dev/null +++ b/scripts/policy/config/pe/pdp.conf @@ -0,0 +1,69 @@ +# Copyright 2020 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. +# pdp component installation configuration parameters + +# tomcat specific parameters + +TOMCAT_JMX_PORT=9991 +TOMCAT_SHUTDOWN_PORT=8087 +SSL_HTTP_CONNECTOR_PORT=8081 +SSL_AJP_CONNECTOR_PORT=8381 +SSL_AJP_CONNECTOR_REDIRECT_PORT=8443 + +TOMCAT_X_MS_MB=512 +TOMCAT_X_MX_MB=512 + +# pdp properties + +UEB_CLUSTER=mr.api.simpledemo.onap.org + +REST_PAP_URL=https://pap:9091/pap/ +REST_PDP_ID=https://pdp:8081/pdp/ +REST_PDP_CONFIG=${{POLICY_HOME}}/servers/pdp/bin/config +REST_PDP_WEBAPPS=${{POLICY_HOME}}/servers/pdp/webapps +REST_PDP_REGISTER=true +REST_PDP_REGISTER_SLEEP=15 +REST_PDP_REGISTER_RETRIES=-1 +REST_PDP_MAXCONTENT=999999999 + +# PDP related properties +PDP_HTTP_USER_ID=testpdp +PDP_HTTP_PASSWORD=alpha123 +PDP_PAP_PDP_HTTP_USER_ID=testpap +PDP_PAP_PDP_HTTP_PASSWORD=alpha123 + +node_type=pdp_xacml +resource_name=pdp_1 +dependency_groups=pdplp_1;brmsgw_1 +test_via_jmx=true + +# +# Notification Properties +# Notification type: websocket, ueb or dmaap... if left blank websocket is the default +PDP_NOTIFICATION_TYPE=websocket +PDP_UEB_CLUSTER= +PDP_UEB_TOPIC= +PDP_UEB_DELAY= +PDP_UEB_API_KEY= +PDP_UEB_API_SECRET= +PDP_DMAAP_AAF_LOGIN= +PDP_DMAAP_AAF_PASSWORD= + +#AAF Policy Name space +#Required only, when we use AAF +POLICY_AAF_NAMESPACE= +POLICY_AAF_RESOURCE= + +# Indeterminate resolution +DECISION_INDETERMINATE_RESPONSE=PERMIT diff --git a/scripts/policy/config/pe/pdplp.conf b/scripts/policy/config/pe/pdplp.conf new file mode 100644 index 00000000..4676b610 --- /dev/null +++ b/scripts/policy/config/pe/pdplp.conf @@ -0,0 +1,25 @@ +# Copyright 2020 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. +# JVM specific parameters +LOGPARSER_JMX_PORT=9997 +LOGPARSER_X_MS_MB=256 +LOGPARSER_X_MX_MB=256 + +SERVER=https://pdp:8081/pdp/ +LOGPATH=/var/log/onap/policy/pdpx/pdp-rest.log +PARSERLOGPATH=${{POLICY_HOME}}/servers/pdplp/bin/IntegrityMonitor.log + +node_type=logparser +# the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase +resource_name=pdplp_1 diff --git a/scripts/policy/config/pe/push-policies.sh b/scripts/policy/config/pe/push-policies.sh new file mode 100755 index 00000000..65013138 --- /dev/null +++ b/scripts/policy/config/pe/push-policies.sh @@ -0,0 +1,506 @@ +#! /bin/bash -x +# Copyright 2020 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. + +#########################################Upload BRMS Param Template########################################## + +echo "Upload BRMS Param Template" + +sleep 2 + +wget -O cl-amsterdam-template.drl https://git.onap.org/policy/drools-applications/plain/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl + +sleep 2 + +curl -k -v --silent -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -F "file=@cl-amsterdam-template.drl" -F "importParametersJson={\"serviceName\":\"ClosedLoopControlName\",\"serviceType\":\"BRMSPARAM\"}" 'https://pdp:8081/pdp/api/policyEngineImport' + +echo "PRELOAD_POLICIES is $PRELOAD_POLICIES" + +if [ "$PRELOAD_POLICIES" == "false" ]; then + exit 0 +fi + +#########################################Create BRMS Param policies########################################## + +echo "Create BRMSParam Operational Policies" + +sleep 2 + +echo "Create BRMSParamvFirewall Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyConfigType": "BRMS_PARAM", + "policyName": "com.BRMSParamvFirewall", + "policyDescription": "BRMS Param vFirewall policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller" : "amsterdam" + }, + "RULE": { + "templateName": "ClosedLoopControlName", + "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a", + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0D%0A++trigger_policy%3A+unique-policy-id-1-modifyConfig%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-modifyConfig%0D%0A++++name%3A+modify+packet+gen+config%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+ModifyConfig%0D%0A++++target%3A%0D%0A++++++%23+TBD+-+Cannot+be+known+until+instantiation+is+done%0D%0A++++++resourceID%3A+Eace933104d443b496b8.nodes.heat.vpg%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+300%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Create BRMSParamvDNS Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyConfigType": "BRMS_PARAM", + "policyName": "com.BRMSParamvDNS", + "policyDescription": "BRMS Param vDNS policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller" : "amsterdam" + }, + "RULE": { + "templateName": "ClosedLoopControlName", + "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "controlLoopYaml": "controlLoop%3A%0A++version%3A+2.0.0%0A++controlLoopName%3A+ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0A++trigger_policy%3A+unique-policy-id-1-scale-up%0A++timeout%3A+1200%0A++abatement%3A+false%0Apolicies%3A%0A++-+id%3A+unique-policy-id-1-scale-up%0A++++name%3A+Create+a+new+VF+Module%0A++++description%3A%0A++++actor%3A+SO%0A++++recipe%3A+VF+Module+Create%0A++++target%3A%0A++++++type%3A+VNF%0A++++payload%3A%0A++++++requestParameters%3A+%27%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D%27%0A++++++configurationParameters%3A+%27%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B9%5D%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B16%5D%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B23%5D%22%7D%5D%27%0A++++retry%3A+0%0A++++timeout%3A+1200%0A++++success%3A+final_success%0A++++failure%3A+final_failure%0A++++failure_timeout%3A+final_failure_timeout%0A++++failure_retries%3A+final_failure_retries%0A++++failure_exception%3A+final_failure_exception%0A++++failure_guard%3A+final_failure_guard" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Create BRMSParamVOLTE Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyConfigType": "BRMS_PARAM", + "policyName": "com.BRMSParamVOLTE", + "policyDescription": "BRMS Param VOLTE policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller" : "amsterdam" + }, + "RULE": { + "templateName": "ClosedLoopControlName", + "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b", + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-restart%0D%0A++++name%3A+Restart+the+VM%0D%0A++++description%3A%0D%0A++++actor%3A+VFC%0D%0A++++recipe%3A+Restart%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Create BRMSParamvCPE Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyConfigType": "BRMS_PARAM", + "policyName": "com.BRMSParamvCPE", + "policyDescription": "BRMS Param vCPE policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller" : "amsterdam" + }, + "RULE": { + "templateName": "ClosedLoopControlName", + "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+true%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-restart%0D%0A++++name%3A+Restart+the+VM%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+Restart%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Create BRMSParamvPCI Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyConfigType": "BRMS_PARAM", + "policyName": "com.BRMSParamvPCI", + "policyDescription": "BRMS Param vPCI policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller" : "casablanca" + }, + "RULE": { + "templateName": "ClosedLoopControlName", + "closedLoopControlName": "ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459", + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+3.0.0%0D%0A++controlLoopName%3A+ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459%0D%0A++trigger_policy%3A+unique-policy-id-123-modifyconfig%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-123-modifyconfig%0D%0A++++name%3A+modify+PCI+config%0D%0A++++description%3A%0D%0A++++actor%3A+SDNR%0D%0A++++recipe%3A+ModifyConfig%0D%0A++++target%3A%0D%0A++++++%23+These+fields+are+not+used%0D%0A++++++resourceID%3A+Eace933104d443b496b8.nodes.heat.vpg%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+300%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Create BRMSParamCCVPN Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyConfigType": "BRMS_PARAM", + "policyName": "com.BRMSParamCCVPN", + "policyDescription": "BRMS Param CCVPN policy", + "policyScope": "com", + "attributes": { + "MATCHING": { + "controller" : "amsterdam" + }, + "RULE": { + "templateName": "ClosedLoopControlName", + "closedLoopControlName": "ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b", + "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b%0D%0A++trigger_policy%3A+unique-policy-id-16-Reroute%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-16-Reroute%0D%0A++++name%3A+Connectivity Reroute%0D%0A++++description%3A%0D%0A++++actor%3A+SDNC%0D%0A++++recipe%3A+Reroute%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +#########################################Create Micro Service Config policies########################################## + +echo "Create MicroService Config Policies" + +sleep 2 + +echo "Create MicroServicevFirewall Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevFirewall\", \"description\": \"MicroService vFirewall Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"vFirewallBroadcastPackets\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": 300, \"direction\": \"LESS_OR_EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ONSET\" }, { \"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": 700, \"direction\": \"GREATER_OR_EQUAL\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" } ] }] } } }", + "policyConfigType": "MicroService", + "policyName": "com.MicroServicevFirewall", + "onapName": "DCAE" +}' 'https://pdp:8081/pdp/api/createPolicy' + + +sleep 2 + +echo "Create MicroServicevDNS Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevDNS\", \"description\": \"MicroService vDNS Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"vLoadBalancer\", \"controlLoopSchemaType\": \"VM\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": 300, \"direction\": \"GREATER_OR_EQUAL\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" }] }] } } }", + "policyConfigType": "MicroService", + "policyName": "com.MicroServicevDNS", + "onapName": "DCAE" +}' 'https://pdp:8081/pdp/api/createPolicy' + + +sleep 2 + +echo "Create MicroServicevCPE Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevCPE\", \"description\": \"MicroService vCPE Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"Measurement_vGMUX\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ABATED\" }, { \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"GREATER\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" }] }] } } }", + "policyConfigType": "MicroService", + "policyName": "com.MicroServicevCPE", + "onapName": "DCAE" +}' 'https://pdp:8081/pdp/api/createPolicy' + +#########################################Create SDNC Naming Policies########################################## + +echo "Create SDNC Naming Policies" + +sleep 2 + +echo "Create SDNC vFW Naming Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VFW_NAMING_TIMESTAMP\",\"naming-models\":[{\"naming-properties\":[{\"property-name\":\"AIC_CLOUD_REGION\"},{\"property-name\":\"nfRole\"},{\"property-name\":\"TIMESTAMP\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNF\",\"nfRole\":\"vFW\",\"naming-recipe\":\"AIC_CLOUD_REGION|DELIMITER|nfRole|DELIMITER|TIMESTAMP\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"ENTIRETY\",\"start-value\":\"001\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}},{\"property-name\":\"NFC_NAMING_CODE\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNFC\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"},{\"property-name\":\"VF_MODULE_LABEL\"},{\"property-name\":\"VF_MODULE_TYPE\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"PRECEEDING\",\"start-value\":\"01\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}}],\"naming-type\":\"VF-MODULE\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"protected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"protected_private_net_id\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"unprotected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"unprotected_private_net_id\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", + "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP", + "policyConfigType": "MicroService", + "onapName": "SDNC", + "riskLevel": "4", + "riskType": "test", + "guard": "false", + "priority": "4", + "description": "ONAP_VFW_NAMING_TIMESTAMP" + }' 'https://pdp:8081/pdp/api/createPolicy' + + sleep 2 + + echo "Create SDNC vPG Naming Policy" + curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VPG_NAMING_TIMESTAMP\",\"naming-models\":[{\"naming-properties\":[{\"property-name\":\"AIC_CLOUD_REGION\"},{\"property-name\":\"nfRole\"},{\"property-name\":\"TIMESTAMP\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNF\",\"nfRole\":\"vPG\",\"naming-recipe\":\"AIC_CLOUD_REGION|DELIMITER|nfRole|DELIMITER|TIMESTAMP\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"ENTIRETY\",\"start-value\":\"001\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}},{\"property-name\":\"NFC_NAMING_CODE\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNFC\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"},{\"property-name\":\"VF_MODULE_LABEL\"},{\"property-name\":\"VF_MODULE_TYPE\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"PRECEEDING\",\"start-value\":\"01\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}}],\"naming-type\":\"VF-MODULE\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"protected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"protected_private_net_id\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"unprotected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"unprotected_private_net_id\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", + "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP", + "policyConfigType": "MicroService", + "onapName": "SDNC", + "riskLevel": "4", + "riskType": "test", + "guard": "false", + "priority": "4", + "description": "ONAP_VPG_NAMING_TIMESTAMP" + }' 'https://pdp:8081/pdp/api/createPolicy' + +#########################################Creating OOF PCI Policies########################################## +sleep 2 + +echo "Create MicroServicevPCI Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation_pci\", \"uuid\": \"test_pci\", \"policyName\": \"MicroServicevPCI\", \"description\": \"MicroService vPCI Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"vFirewallBroadcastPackets\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.executePolicy\", \"thresholdValue\": 1, \"direction\": \"GREATER_OR_EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ONSET\" } ] }] } } }", + "policyConfigType": "MicroService", + "policyName": "com.MicroServicevPCI", + "onapName": "DCAE" +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Create PCI MS Config Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyName": "com.PCIMS_CONFIG_POLICY", + "configBody": "{ \"PCI_NEIGHBOR_CHANGE_CLUSTER_TIMEOUT_IN_SECS\":60, \"PCI_MODCONFIG_POLICY_NAME\":\"ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459\", \"PCI_OPTMIZATION_ALGO_CATEGORY_IN_OOF\":\"OOF-PCI-OPTIMIZATION\", \"PCI_SDNR_TARGET_NAME\":\"SDNR\" }", + "policyType": "Config", + "attributes" : { "matching" : { "key1" : "value1" } }, + "policyConfigType": "Base", + "onapName": "DCAE", + "configName": "PCIMS_CONFIG_POLICY", + "configBodyType": "JSON" +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Create OOF Config Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyName": "com.OOF_PCI_CONFIG_POLICY", + "configBody": "{ \"ALGO_CATEGORY\":\"OOF-PCI-OPTIMIZATION\", \"PCI_OPTMIZATION_ALGO_NAME\":\"OOF-PCI-OPTIMIZATION-LEVEL1\", \"PCI_OPTIMIZATION_NW_CONSTRAINT\":\"MAX5PCICHANGESONLY\", \"PCI_OPTIMIZATION_PRIORITY\": 2, \"PCI_OPTIMIZATION_TIME_CONSTRAINT\":\"ONLYATNIGHT\" }", + "attributes" : { "matching" : { "key1" : "value1" } }, + "policyType": "Config", + "policyConfigType": "Base", + "onapName": "DCAE", + "configName": "OOF_PCI_CONFIG_POLICY", + "configBodyType": "JSON" +}' 'https://pdp:8081/pdp/api/createPolicy' + +#########################################Creating Decision Guard policies######################################### + +sleep 2 + +echo "Creating Decision Guard policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyClass": "Decision", + "policyName": "com.AllPermitGuard", + "policyDescription": "Testing all Permit YAML Guard Policy", + "onapName": "PDPD", + "ruleProvider": "GUARD_YAML", + "attributes": { + "MATCHING": { + "actor": ".*", + "recipe": ".*", + "targets": ".*", + "clname": ".*", + "limit": "10", + "timeWindow": "1", + "timeUnits": "minute", + "guardActiveStart": "00:00:01-05:00", + "guardActiveEnd": "23:59:59-05:00" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Creating Decision vDNS Guard - Frequency Limiter policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyClass": "Decision", + "policyName": "com.vDNS_Frequency", + "policyDescription": "Limit vDNS Scale Up over time period", + "onapName": "PDPD", + "ruleProvider": "GUARD_YAML", + "attributes": { + "MATCHING": { + "actor": "SO", + "recipe": "scaleOut", + "targets": ".*", + "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "limit": "1", + "timeWindow": "10", + "timeUnits": "minute", + "guardActiveStart": "00:00:01-05:00", + "guardActiveEnd": "23:59:59-05:00" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +sleep 2 + +echo "Creating Decision vDNS Guard - Min/Max policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "policyClass": "Decision", + "policyName": "com.vDNS_MinMax", + "policyDescription": "Ensure number of instances within a range", + "onapName": "SampleDemo", + "ruleProvider": "GUARD_MIN_MAX", + "attributes": { + "MATCHING": { + "actor": "SO", + "recipe": "scaleOut", + "targets": ".*", + "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "min": "1", + "max": "5", + "guardActiveStart": "00:00:01-05:00", + "guardActiveEnd": "23:59:59-05:00" + } + } +}' 'https://pdp:8081/pdp/api/createPolicy' + +#########################################Push Decision policy######################################### + +sleep 2 + +echo "Push Decision policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.AllPermitGuard", + "policyType": "DECISION" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 2 + +echo "Push Decision policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.vDNS_Frequency", + "policyType": "DECISION" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 2 + +echo "Push Decision policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.vDNS_MinMax", + "policyType": "DECISION" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +#########################################Pushing BRMS Param policies########################################## + +echo "Pushing BRMSParam Operational policies" + +sleep 2 + +echo "pushPolicy : PUT : com.BRMSParamvFirewall" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.BRMSParamvFirewall", + "policyType": "BRMS_Param" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 2 + +echo "pushPolicy : PUT : com.BRMSParamvDNS" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.BRMSParamvDNS", + "policyType": "BRMS_Param" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 2 + +echo "pushPolicy : PUT : com.BRMSParamVOLTE" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.BRMSParamVOLTE", + "policyType": "BRMS_Param" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 2 + +echo "pushPolicy : PUT : com.BRMSParamvCPE" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.BRMSParamvCPE", + "policyType": "BRMS_Param" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 2 + +echo "pushPolicy : PUT : com.BRMSParamvPCI" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.BRMSParamvPCI", + "policyType": "BRMS_Param" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 2 + +echo "pushPolicy : PUT : com.BRMSParamCCVPN" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.BRMSParamCCVPN", + "policyType": "BRMS_Param" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +#########################################Pushing MicroService Config policies########################################## + +echo "Pushing MicroService Config policies" + +sleep 2 + +echo "pushPolicy : PUT : com.MicroServicevFirewall" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.MicroServicevFirewall", + "policyType": "MicroService" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 10 + +echo "pushPolicy : PUT : com.MicroServicevDNS" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.MicroServicevDNS", + "policyType": "MicroService" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 10 + +echo "pushPolicy : PUT : com.MicroServicevCPE" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.MicroServicevCPE", + "policyType": "MicroService" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +#########################################Pushing SDNC Naming Policies########################################## +echo "Pushing SDNC Naming Policies" + +sleep 2 + +echo "pushPolicy : PUT : SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP", + "policyType": "MicroService" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 10 + +echo "pushPolicy : PUT : SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP", + "policyType": "MicroService" +}' 'https://pdp:8081/pdp/api/pushPolicy' + + +#########################################Pushing OOF PCI Policies########################################## +sleep 10 + +echo "pushPolicy : PUT : com.MicroServicevPCI" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.MicroServicevPCI", + "policyType": "MicroService" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 10 + +echo "pushPolicy : PUT : com.PCIMS_CONFIG_POLICY" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.PCIMS_CONFIG_POLICY", + "policyType": "Base" +}' 'https://pdp:8081/pdp/api/pushPolicy' + +sleep 10 + +echo "pushPolicy : PUT : com.OOF_PCI_CONFIG_POLICY" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "com.OOF_PCI_CONFIG_POLICY", + "policyType": "Base" +}' 'https://pdp:8081/pdp/api/pushPolicy' diff --git a/scripts/policy/docker-compose-drools-apps.yml b/scripts/policy/docker-compose-drools-apps.yml index 14a2161f..704de81b 100644 --- a/scripts/policy/docker-compose-drools-apps.yml +++ b/scripts/policy/docker-compose-drools-apps.yml @@ -1,4 +1,4 @@ -# Copyright 2019 AT&T Intellectual Property. All rights reserved +# Copyright 2019-2020 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. @@ -34,14 +34,8 @@ services: - 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 - + - ${WORKSPACE}/scripts/policy/config/drools-apps/custom:/tmp/policy-install/config + env_file: + - ${WORKSPACE}/scripts/policy/config/drools-apps/env/base.conf + - ${WORKSPACE}/scripts/policy/config/drools-apps/env/feature-healthcheck.conf + - ${WORKSPACE}/scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf diff --git a/scripts/policy/docker-compose-drools.yml b/scripts/policy/docker-compose-drools.yml index ffee9cdc..974b465f 100644 --- a/scripts/policy/docker-compose-drools.yml +++ b/scripts/policy/docker-compose-drools.yml @@ -1,4 +1,4 @@ -# Copyright 2018 AT&T Intellectual Property. All rights reserved +# Copyright 2018-2020 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. @@ -14,42 +14,34 @@ version: '2' services: mariadb: - image: mariadb:10.2.14 + image: mariadb:${POLICY_MARIADB_VER} container_name: mariadb hostname: mariadb command: ['--lower-case-table-names=1', '--wait_timeout=28800'] - env_file: config/db/db.conf + env_file: + - ${WORKSPACE}/scripts/policy/config/db/db.conf volumes: - - ./config/db:/docker-entrypoint-initdb.d + - ${WORKSPACE}/scripts/policy/config/db:/docker-entrypoint-initdb.d expose: - - 3306 + - 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 + - 8081 drools: - image: onap/policy-drools + image: nexus3.onap.org:10001/onap/policy-drools:${POLICY_DROOLS_VERSION} + user: 1000:1000 container_name: drools depends_on: - - mariadb - - nexus + - mariadb + - nexus hostname: drools expose: - - 6969 - - 9696 + - 6969 + - 9696 volumes: - - ./config/drools:/tmp/policy-install/config + - ${WORKSPACE}/scripts/policy/config/drools/custom:/tmp/policy-install/config + env_file: + - ${WORKSPACE}/scripts/policy/config/drools/env/base.conf diff --git a/scripts/policy/docker-compose-engine.yml b/scripts/policy/docker-compose-engine.yml index e67729e2..1fc5f9f3 100644 --- a/scripts/policy/docker-compose-engine.yml +++ b/scripts/policy/docker-compose-engine.yml @@ -14,13 +14,14 @@ version: '2' services: mariadb: - image: mariadb:10.2.14 + image: mariadb:${POLICY_MARIADB_VER} container_name: mariadb hostname: mariadb command: ['--lower-case-table-names=1', '--wait_timeout=28800'] - env_file: config/db/db.conf + env_file: + - ${WORKSPACE}/scripts/policy/config/db/db.conf volumes: - - ./config/db:/docker-entrypoint-initdb.d + - ${WORKSPACE}/scripts/policy/config/db:/docker-entrypoint-initdb.d expose: - 3306 nexus: @@ -28,7 +29,7 @@ services: container_name: nexus hostname: nexus pap: - image: onap/policy-pe + image: nexus3.onap.org:10001/onap/policy-pe:${POLICY_ENGINE_VERSION} environment: - PRELOAD_POLICIES=${PRELOAD_POLICIES} container_name: pap @@ -40,9 +41,9 @@ services: - 9091 command: pap volumes: - - ./config/pe:/tmp/policy-install/config + - ${WORKSPACE}/scripts/policy/config/pe:/tmp/policy-install/config pdp: - image: onap/policy-pe + image: nexus3.onap.org:10001/onap/policy-pe:${POLICY_ENGINE_VERSION} container_name: pdp depends_on: - pap @@ -53,23 +54,11 @@ services: volumes: - ./config/pe:/tmp/policy-install/config brmsgw: - image: onap/policy-pe + image: nexus3.onap.org:10001/onap/policy-pe:${POLICY_ENGINE_VERSION} 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 + - ${WORKSPACE}/scripts/policy/config/pe:/tmp/policy-install/config diff --git a/scripts/policy/drools-pdp-script.sh b/scripts/policy/drools-pdp-script.sh deleted file mode 100755 index 6e14931f..00000000 --- a/scripts/policy/drools-pdp-script.sh +++ /dev/null @@ -1,246 +0,0 @@ -#!/bin/bash -x -# -# Copyright 2017-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. -# -echo "This is ${WORKSPACE}/scripts/policy/drools-pdp-script.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 -# download maven from automatically selected mirror server -curl -vLO "https://www.apache.org/dyn/mirrors/mirrors.cgi?cca2=us&preferred=http://apache.claz.org/&action=download&filename=maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz" -if ! tar -xzvf apache-maven-3.3.9-bin.tar.gz ; then - echo "Installation of maven has failed!" - exit 1 -fi -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 - -${DIR}/wait_for_port.sh ${MARIADB_IP} 3306 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${MARIADB_IP} 3306" - telnet ${MARIADB_IP} 3306 < /dev/null - nc -vz ${MARIADB_IP} 3306 - docker logs mariadb - exit $rc -fi - -${DIR}/wait_for_port.sh ${NEXUS_IP} 8081 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${NEXUS_IP} 8081" - telnet ${NEXUS_IP} 8081 < /dev/null - nc -vz ${NEXUS_IP} 8081 - docker logs nexus - exit $rc -fi - -${DIR}/wait_for_port.sh ${POLICY_IP} 9696 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${POLICY_IP} 9696" - telnet ${POLICY_IP} 9696 < /dev/null - nc -vz ${POLICY_IP} 9696 - docker logs drools - exit $rc -fi - -${DIR}/wait_for_port.sh ${PAP_IP} 9091 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${PAP_IP} 9091" - telnet ${PAP_IP} 9091 < /dev/null - nc -vz ${PAP_IP} 9091 - docker logs pap - exit $rc -fi - -${DIR}/wait_for_port.sh ${PDP_IP} 8081 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${PDP_IP} 8081" - telnet ${PDP_IP} 8081 < /dev/null - nc -vz ${PDP_IP} 8081 - docker logs pdp - exit $rc -fi - -${DIR}/wait_for_port.sh ${BRMS_IP} 9989 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${BRMS_IP} 9989" - telnet ${BRMS_IP} 9989" < /dev/null - nc -vz ${BRMS_IP} 9989" - docker logs brmsgw - exit $rc -fi - -docker logs drools -docker logs pap -docker logs pdp -docker logs brmsgw - -TIME_OUT=300 -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}:9696/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 - -# -# Add more sleep for everything to settle -# -sleep 3m diff --git a/scripts/policy/engine.sh b/scripts/policy/engine.sh deleted file mode 100755 index 3e9f3d42..00000000 --- a/scripts/policy/engine.sh +++ /dev/null @@ -1,264 +0,0 @@ -#!/bin/bash -x -# -# Copyright 2017-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. -# -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 -# download maven from automatically selected mirror server -curl -vLO "https://www.apache.org/dyn/mirrors/mirrors.cgi?cca2=us&preferred=http://apache.claz.org/&action=download&filename=maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz" -if ! tar -xzvf apache-maven-3.3.9-bin.tar.gz ; then - echo "Installation of maven has failed!" - exit 1 -fi -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 - -${DIR}/wait_for_port.sh ${MARIADB_IP} 3306 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${MARIADB_IP} 3306" - telnet ${MARIADB_IP} 3306 < /dev/null - nc -vz ${MARIADB_IP} 3306 - docker logs mariadb - exit $rc -fi - -${DIR}/wait_for_port.sh ${NEXUS_IP} 8081 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${NEXUS_IP} 8081" - netstat -tnl - telnet ${NEXUS_IP} 8081 < /dev/null - nc -vz ${NEXUS_IP} 8081 - docker logs nexus - exit $rc -fi - -${DIR}/wait_for_port.sh ${POLICY_IP} 9696 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${POLICY_IP} 9696" - netstat -tnl - telnet ${POLICY_IP} 9696 < /dev/null - nc -vz ${POLICY_IP} 9696 - docker logs drools - exit $rc -fi - -${DIR}/wait_for_port.sh ${PAP_IP} 9091 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${PAP_IP} 9091" - netstat -tnl - telnet ${PAP_IP} 9091 < /dev/null - nc -vz ${PAP_IP} 9091 - docker logs pap - exit $rc -fi - -${DIR}/wait_for_port.sh ${PDP_IP} 8081 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${PDP_IP} 8081" - netstat -tnl - telnet ${PDP_IP} 8081 < /dev/null - nc -vz ${PDP_IP} 8081 - docker logs pdp - exit $rc -fi - -${DIR}/wait_for_port.sh ${BRMS_IP} 9989 -rc=$? -if [[ $rc != 0 ]]; then - echo "cannot open ${BRMS_IP} 9989" - netstat -tnl - telnet ${BRMS_IP} 9989" < /dev/null - nc -vz ${BRMS_IP} 9989" - docker logs brmsgw - exit $rc -fi - -docker logs drools -docker logs pap -docker logs pdp -docker logs brmsgw - -TIME_OUT=300 -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=300 -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/policy-distribution/config/distribution/csar/sample_csar_with_apex_policy.csar b/scripts/policy/policy-distribution/config/distribution/csar/sample_csar_with_apex_policy.csar index 76f45ea5b33ba275255dee7ca86d0427131d5fbd..3b1ed6f3ee2e348b37ae05dc3cdcfcc895ed0182 100644 GIT binary patch delta 10218 zcmZvC1yCK`vNbLTC%C&igaE+_?gw`d?yiHo1os4jy9R;>cXzj7!QJ5}->ZA?|8BjR zn$vrx`t+V&y;kp;s=2s^O}>WpuZMgkMQyWFP@1K%;ArE9fS5!}MInP!1hRFUx4E$V z*YB}Ogdpn}nl)=ty2TD~=u$%#Qlhbj)-+?msj=gB?kY|01t z_I&u7iK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4@{$y7fCn%V=_v)9dT~9^T$sl)fjDjk z)nIj}qk}Wt@nN?TiJB|+jR z{t}S$h^VT7h!nFTpf`#D0=;EOH**4$w<#Ed5lQ~vf8aP8Pbh(z;u6aRVrNgKRbg! Qtbdv!DF~Ec4E{6vKOQa(vj6}9 diff --git a/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json b/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json index 810d970d..ed030d1d 100644 --- a/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json +++ b/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.json @@ -50,17 +50,17 @@ "default": "1.0.0" }, "id": { - "type": "int", + "type": "integer", "description": "Specifies the engine id", "required": true }, "instance_count": { - "type": "int", + "type": "integer", "description": "Specifies the number of engine threads that should be run", "required": true }, "deployment_port": { - "type": "int", + "type": "integer", "description": "Specifies the port to connect to for engine administration", "required": false, "default": 1 @@ -68,14 +68,12 @@ "policy_model_file_name": { "type": "string", "description": "The name of the file from which to read the APEX policy model", - "required": false, - "default": "" + "required": false }, "policy_type_impl": { "type": "string", "description": "The policy type implementation from which to read the APEX policy model", - "required": false, - "default": "" + "required": false }, "periodic_event_period": { "type": "string", @@ -119,7 +117,7 @@ "required": false }, "synchronous_mode": { - "type": "bool", + "type": "boolean", "description": "Specifies the event handler is syncronous (receive event and send response)", "required": false, "default": false @@ -127,17 +125,15 @@ "synchronous_peer": { "type": "string", "description": "The peer event handler (output for input or input for output) of this event handler in synchronous mode, this parameter is mandatory if the event handler is in synchronous mode", - "required": false, - "default": "" + "required": false }, "synchronous_timeout": { - "type": "int", + "type": "integer", "description": "The timeout in milliseconds for responses to be issued by APEX torequests, this parameter is mandatory if the event handler is in synchronous mode", - "required": false, - "default": "" + "required": false }, "requestor_mode": { - "type": "bool", + "type": "boolean", "description": "Specifies the event handler is in requestor mode (send event and wait for response mode)", "required": false, "default": false @@ -145,14 +141,12 @@ "requestor_peer": { "type": "string", "description": "The peer event handler (output for input or input for output) of this event handler in requestor mode, this parameter is mandatory if the event handler is in requestor mode", - "required": false, - "default": "" + "required": false }, "requestor_timeout": { - "type": "int", + "type": "integer", "description": "The timeout in milliseconds for wait for responses to requests, this parameter is mandatory if the event handler is in requestor mode", - "required": false, - "default": "" + "required": false } } }, @@ -186,7 +180,7 @@ } } }, - "onap.datatypes.policies.controlloop.operational.apex.Environmental": { + "onap.datatypes.policies.controlloop.operational.apex.Environment": { "derived_from": "tosca.datatypes.Root", "properties": { "name": { @@ -237,7 +231,7 @@ } }, "locking": { - "type": "onap.datatypes.policies.controlloop.operational.apex.plugin", + "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin", "description": "The plugin to be used for locking context in and between APEX PDPs at runtime", "required": false }, diff --git a/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.tosca.json b/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.tosca.json index b58e5b5b..d03d8fae 100644 --- a/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.tosca.json +++ b/tests/policy/apex-pdp/data/onap.policies.controlloop.operational.Apex.tosca.json @@ -6,7 +6,6 @@ "operational.sampledomain": { "type": "onap.policies.controlloop.operational.Apex", "type_version": "1.0.0", - "derived_from": "tosca.policies.Root", "name": "onap.policies.controlloop.Operational.apex.sampledomain", "version": "1.0.0", "properties": { diff --git a/tests/policy/api/api-test.robot b/tests/policy/api/api-test.robot index 19aa18ab..76c1bdc6 100644 --- a/tests/policy/api/api-test.robot +++ b/tests/policy/api/api-test.robot @@ -39,7 +39,7 @@ RetrievePolicyTypes Should Be Equal As Strings ${resp.json()['version']} 1.0.0 CreateTCAPolicyTypeV1 - [Documentation] Create TCA Policy Type Version 1 + [Documentation] Create TCA Policy Type Version 1. Trying to create an existing policy type with any change and same version should cause error. ${auth}= Create List healthcheck zb!XztG34 ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json Log Creating session https://${POLICY_API_IP}:6969 @@ -90,9 +90,9 @@ CreateNewMonitoringPolicyV1 Dictionary Should Contain Key ${postjsonobject['topology_template']['policies'][0]} onap.restart.tca SimpleCreateNewMonitoringPolicyV1 - [Documentation] Create a new Monitoring TCA policiy version 1 using simple endpoint + [Documentation] Create a new Monitoring TCA policiy version 1 using simple endpoint. Trying to create an existing policy with any change and same version should cause error. ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1.json + ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1_2.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json diff --git a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json b/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json index f06247d7..1db64f83 100644 --- a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json +++ b/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json @@ -3,6 +3,7 @@ "policy_types": { "onap.policies.Monitoring": { "derived_from": "tosca.policies.Root", + "version": "1.0.0", "description": "a base policy type for all policies that governs monitoring provisioning" }, "onap.policies.monitoring.cdap.tca.hi.lo.app": { @@ -210,4 +211,4 @@ } } } -} \ No newline at end of file +} diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json new file mode 100644 index 00000000..a3faae4d --- /dev/null +++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json @@ -0,0 +1,52 @@ +{ + "tosca_definitions_version": "tosca_simple_yaml_1_0_0", + "topology_template": { + "policies": [ + { + "onap.restart.tca": { + "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "version": "1.0.0", + "type_version": "1.0.0", + "description": "monitoring policy", + "metadata": { + "policy-id": "onap.restart.tca" + }, + "properties": { + "tca_policy" : { + "domain": "measurementsForVfScaling", + "metricsPerEventName": [ + { + "eventName": "Measurement_vGMUX", + "controlLoopSchemaType": "VNF", + "policyScope": "DCAE", + "policyName": "DCAE.Config_tca-hi-lo", + "policyVersion": "v0.0.1", + "thresholds": [ + { + "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", + "version": "1.0.2", + "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", + "thresholdValue": 0, + "direction": "EQUAL", + "severity": "MAJOR", + "closedLoopEventStatus": "ABATED" + }, + { + "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", + "version": "1.0.2", + "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", + "thresholdValue": 0, + "direction": "GREATER", + "severity": "CRITICAL", + "closedLoopEventStatus": "ONSET" + } + ] + } + ] + } + } + } + } + ] + } +} diff --git a/tests/policy/drools-applications/drools-applications-test.robot b/tests/policy/drools-applications/drools-applications-test.robot index cf4d3cea..1c9ea1d8 100644 --- a/tests/policy/drools-applications/drools-applications-test.robot +++ b/tests/policy/drools-applications/drools-applications-test.robot @@ -15,3 +15,26 @@ Alive Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As Strings ${resp.json()['alive']} True + +Healthcheck + [Documentation] Runs Policy PDP-D Health check + ${auth}= Create List demo@people.osaaf.org demo123456! + Log Creating session https://${POLICY_DROOLS_IP}:6969/healthcheck + ${session}= Create Session policy https://${POLICY_DROOLS_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request policy /healthcheck headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.json()['healthy']} True + +Usecases + [Documentation] Checks usecases controller is up + ${auth}= Create List demo@people.osaaf.org demo123456! + Log Creating session https://${POLICY_DROOLS_IP}:9696 + ${session}= Create Session policy https://${POLICY_DROOLS_IP}:9696 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request policy /policy/pdp/engine/controllers/usecases/drools/facts headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.json()['usecases']} 0 + diff --git a/tests/policy/drools-pdp/drools-pdp-test.robot b/tests/policy/drools-pdp/drools-pdp-test.robot index fdb46a92..cf4d3cea 100644 --- a/tests/policy/drools-pdp/drools-pdp-test.robot +++ b/tests/policy/drools-pdp/drools-pdp-test.robot @@ -8,8 +8,8 @@ Library json Alive [Documentation] Runs Policy PDP Alive Check ${auth}= Create List demo@people.osaaf.org demo123456! - Log Creating session https://${POLICY_IP}:9696 - ${session}= Create Session policy https://${POLICY_IP}:9696 auth=${auth} + Log Creating session https://${POLICY_DROOLS_IP}:9696 + ${session}= Create Session policy https://${POLICY_DROOLS_IP}:9696 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json ${resp}= Get Request policy /policy/pdp/engine headers=${headers} Log Received response from policy ${resp.text} diff --git a/tests/policy/engine/Policy-CSIT.robot b/tests/policy/engine/Policy-CSIT.robot deleted file mode 100644 index e55ccac8..00000000 --- a/tests/policy/engine/Policy-CSIT.robot +++ /dev/null @@ -1,425 +0,0 @@ -*** Settings *** -Documentation Policy ONAP CSIT Test cases -Library String -Library HttpLibrary.HTTP -LIbrary Process -Library BuiltIn -Library ONAPLibrary.Templating -Resource policy_interface.robot - -*** Variables *** -${RESOURCE_PATH_CREATE} /pdp/api/createPolicy -${RESOURCE_PATH_CREATE_PUSH} /pdp/api/pushPolicy -${RESOURCE_PATH_CREATE_DELETE} /pdp/api/deletePolicy -${RESOURCE_PATH_GET_CONFIG} /pdp/api/getConfig -${RESOURCE_PATH_LISTPOLICY} /pdp/api/listPolicy -${CREATE_CONFIG_VFW_TEMPLATE} configpolicy_vFW_R1.jinja -${CREATE_CONFIG_VDNS_TEMPLATE} configpolicy_vDNS_R1.jinja -${CREATE_CONFIG_VCPE_TEMPLATE} configpolicy_vCPE_R1.jinja -${CREATE_OPS_VFW_TEMPLATE} opspolicy_VFW_R1.jinja -${CREATE_OOF_HPA_TEMPLATE} oofpolicy_HPA_R1.jinja -${CREATE_SDNC_VFW_TEMPLATE} sdncnamingpolicy_vFW.jinja -${CREATE_SDNC_VPG_TEMPLATE} sdncnamingpolicy_vPG.jinja -${PUSH_POLICY_TEMPLATE} pushpolicy.jinja -${MULTIPLE_PUSH_POLICY_TEMPLATE} multiple_pushpolicy.jinja -${MULTIPLE_UNPUSH_POLICY_TEMPLATE} multiple_unpushpolicy.jinja -${CREATE_OPS_VDNS_TEMPLATE} opspolicy_VDNS_R1.jinja -${DEL_POLICY_TEMPLATE} deletepolicy.jinja -${GETCONFIG_TEMPLATE} getconfigpolicy.jinja -${GETOOF_TEMPLATE} getoofpolicy.jinja -${LISTPOLICY_TEMPLATE} listpolicy.jinja -${CONFIG_POLICY_VFW_NAME} vFirewall -${CONFIG_POLICY_VFW_TYPE} MicroService -${CONFIG_POLICY_VDNS_NAME} vLoadBalancer -${CONFIG_POLICY_VDNS_TYPE} MicroService -${OPS_POLICY_VFW_NAME} vFirewall -${OPS_POLICY_VFW_TYPE} BRMS_PARAM -${OPS_POLICY_VDNS_NAME} vLoadBalancer -${OPS_POLICY_VDNS_TYPE} BRMS_PARAM -${CONFIG_POLICY_VCPE_NAME} vCPE -${CONFIG_POLICY_VCPE_TYPE} MicroService -${OPS_POLICY_VCPE_NAME} vCPE -${OPS_POLICY_VCPE_TYPE} BRMS_PARAM -${OPS_POLICY_VOLTE_NAME} VoLTE -${OPS_POLICY_VOLTE_TYPE} BRMS_PARAM -${OOF_POLICY_HPA_NAME} HPA -${OOF_POLICY_HPA_TYPE} Optimization -${SDNC_POLICY_VFW_NAME} ONAP_vFW_Naming -${SDNC_POLICY_VPG_NAME} ONAP_vPG_Naming -${MULTIPLE_PUSH_POLICY_NAME1} com.testBase1 -${MULTIPLE_PUSH_POLICY_NAME2} com.testBase2 -${MULTIPLE_PUSH_POLICY_NAME3} com.testBase3 -${file_path} ../testsuite/robot/assets/templates/ControlLoopDemo__closedLoopControlName.drl -${RESOURCE_PATH_UPLOAD} /pdp/api/policyEngineImport?importParametersJson=%7B%22serviceName%22%3A%22Manyu456%22%2C%20%22serviceType%22%3A%22BRMSPARAM%22%7D -${CREATE_OPS_VCPE_TEMPLATE} opspolicy_vCPE_R1.jinja -${CREATE_OPS_VOLTE_TEMPLATE} opspolicy_vOLTE_R1.jinja - - -*** Test Cases *** -Policy Health check - Run Policy Health Check - -VFW Config Policy - ${CONFIG_POLICY_VFW_NAME}= Create Config VFW Policy - Push Config Policy ${CONFIG_POLICY_VFW_NAME} ${CONFIG_POLICY_VFW_TYPE} - #VFW Policy Tests - -VDNS Config Policy - ${CONFIG_POLICY_VDNS_NAME}= Create Config VDNS Policy - Push Config Policy ${CONFIG_POLICY_VDNS_NAME} ${CONFIG_POLICY_VDNS_TYPE} - #VDNS Policy Tests - -VCPE Config Policy - ${CONFIG_POLICY_VCPE_NAME}= Create Config VCPE Policy - Push Config Policy ${CONFIG_POLICY_VCPE_NAME} ${CONFIG_POLICY_VCPE_TYPE} - #VCPE Policy Tests - -VFW Ops Policy - ${OPS_POLICY_VFW_NAME}= Create Ops VFW Policy - Push Ops Policy ${OPS_POLICY_VFW_NAME} ${OPS_POLICY_VFW_TYPE} - -VDNS Ops Policy - ${OPS_POLICY_VDNS_NAME}= Create Ops VDNS Policy - Push Ops Policy ${OPS_POLICY_VDNS_NAME} ${OPS_POLICY_VDNS_TYPE} - -VCPE Ops Policy - ${OPS_POLICY_VCPE_NAME}= Create Ops VCPE Policy - Push Ops Policy ${OPS_POLICY_VCPE_NAME} ${OPS_POLICY_VCPE_TYPE} - -VOLTE Ops Policy - ${OPS_POLICY_VOLTE_NAME}= Create Ops VOLTE Policy - Push Ops Policy ${OPS_POLICY_VOLTE_NAME} ${OPS_POLICY_VOLTE_TYPE} - #VOLTE Policy Tests - -VFW SDNC Naming Policy - ${SDNC_POLICY_VFW_NAME}= Create VFW SDNC Naming Policy - Push Config Policy ${SDNC_POLICY_VFW_NAME} ${CONFIG_POLICY_VFW_TYPE} - #VFW Policy Tests - -VPG SDNC Naming Policy - ${SDNC_POLICY_VPG_NAME}= Create VPG SDNC Naming Policy - Push Config Policy ${SDNC_POLICY_VPG_NAME} ${CONFIG_POLICY_VFW_TYPE} - #VPG Policy Tests - -HPA OOF Policy - ${OOF_POLICY_HPA_NAME}= Create OOF HPA Policy - Push Config Policy ${OOF_POLICY_HPA_NAME} ${OOF_POLICY_HPA_TYPE} - #HPA Policy Tests - -VFW Get Configs Policy - Sleep 5s - Get Configs VFW Policy - -VDNS Get Configs Policy - Sleep 5s - Get Configs VDNS Policy - -VCPE Get Configs Policy - Sleep 5s - Get Configs VCPE Policy - -HPA Get OOF Policy - Sleep 5s - Get OOF HPA Policy - -ListPolicy - ListPolicy test com.Config_Sample.1.xml - -Multiple Push Policy - ${MULTIPLE_PUSH_POLICY_NAME1}= Create Ops VDNS Policy - ${MULTIPLE_PUSH_POLICY_NAME2}= Create Ops VDNS Policy - ${MULTIPLE_PUSH_POLICY_NAME3}= Create Ops VDNS Policy - Push Multiple Policy test ${MULTIPLE_PUSH_POLICY_NAME1} ${MULTIPLE_PUSH_POLICY_NAME2} ${MULTIPLE_PUSH_POLICY_NAME3} ${OPS_POLICY_VDNS_TYPE} - Sleep 5s - Delete Multiple Policy test ${MULTIPLE_PUSH_POLICY_NAME1} ${MULTIPLE_PUSH_POLICY_NAME2} ${MULTIPLE_PUSH_POLICY_NAME3} ${OPS_POLICY_VDNS_TYPE} - -*** Keywords *** - -VFW Policy Tests - ${CONFIG_POLICY_VFW_NAME}= Create Config VFW Policy - Push Config Policy ${CONFIG_POLICY_VFW_NAME} ${CONFIG_POLICY_VFW_TYPE} - Get Configs VFW Policy - ${OPS_POLICY_VFW_NAME}= Create Ops VFW Policy - Push Ops Policy ${OPS_POLICY_VFW_NAME} ${OPS_POLICY_VFW_TYPE} - ${SDNC_POLICY_VFW_NAME}= Create VFW SDNC Naming Policy - Push Config Policy ${CONFIG_POLICY_VFW_NAME} ${CONFIG_POLICY_VFW_TYPE} - -VDNS Policy Tests - ${CONFIG_POLICY_VDNS_NAME}= Create Config VDNS Policy - Push Config Policy ${CONFIG_POLICY_VDNS_NAME} ${CONFIG_POLICY_VDNS_TYPE} - Get Configs VDNS Policy - ${OPS_POLICY_VDNS_NAME}= Create Ops VDNS Policy - Push Ops Policy ${OPS_POLICY_VDNS_NAME} ${OPS_POLICY_VDNS_TYPE} - -VCPE Policy Tests - ${CONFIG_POLICY_VCPE_NAME}= Create Config VCPE Policy - Push Config Policy ${CONFIG_POLICY_VCPE_NAME} ${CONFIG_POLICY_VCPE_TYPE} - Get Configs VCPE Policy - ${OPS_POLICY_VCPE_NAME}= Create Ops VCPE Policy - Push Ops Policy ${OPS_POLICY_VCPE_NAME} ${OPS_POLICY_VCPE_TYPE} - -VPG Policy Tests - ${SDNC_POLICY_VPG_NAME}= Create VPG SDNC Naming Policy - Push Config Policy ${SDNC_POLICY_VPG_NAME} ${CONFIG_POLICY_VFW_TYPE} - -VOLTE Policy Tests - ${OPS_POLICY_VOLTE_NAME}= Create Ops VOLTE Policy - Push Ops Policy ${OPS_POLICY_VOLTE_NAME} ${OPS_POLICY_VOLTE_TYPE} - -HPA Policy Tests - ${OOF_POLICY_HPA_NAME}= Create OOF HPA Policy - Push Config Policy ${OOF_POLICY_HPA_NAME} ${OOF_POLICY_HPA_TYPE} - Get OOF HPA Policy - -Get Configs VFW Policy - [Documentation] Get Config Policy for VFW - Create Environment policy ${CURDIR} - ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VFW_NAME}* - ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} - ${output} = Apply Template policy ${GETCONFIG_TEMPLATE} ${configpolicy_name} - ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} - Should Be Equal As Strings ${get_resp.status_code} 200 - -Create OOF HPA Policy - [Documentation] Create OOF Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_HPA - ${OOF_POLICY_HPA_NAME}= Set Test Variable ${policyname1} - ${hpapolicy}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_OOF_HPA_TEMPLATE} ${hpapolicy} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Log ${put_resp} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Get OOF HPA Policy - [Documentation] Get OOF Policy for HPA - Create Environment policy ${CURDIR} - ${gethpapolicy}= Catenate .*${OOF_POLICY_HPA_NAME}* - ${hpapolicy_name}= Create Dictionary oof_policy_name=${gethpapolicy} - ${output} = Apply Template policy ${GETOOF_TEMPLATE} ${hpapolicy_name} - ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} - Should Be Equal As Strings ${get_resp.status_code} 200 - -Create Config VFW Policy - [Documentation] Create Config Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_vFirewall - ${CONFIG_POLICY_VFW_NAME}= Set Test Variable ${policyname1} - ${configpolicy}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_CONFIG_VFW_TEMPLATE} ${configpolicy} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Create VPG SDNC Naming Policy - [Documentation] Create VPG SDNC Naming Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_ONAP_vPG_Naming - ${SDNC_POLICY_VPG_NAME}= Set Test Variable ${policyname1} - ${sdncpolicy}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_SDNC_VPG_TEMPLATE} ${sdncpolicy} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Create VFW SDNC Naming Policy - [Documentation] Create VFW SDNC Naming Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_ONAP_vFW_Naming - ${SDNC_POLICY_VFW_NAME}= Set Test Variable ${policyname1} - ${sdncpolicy}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_SDNC_VFW_TEMPLATE} ${sdncpolicy} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Create Policy Name - [Documentation] Generate Policy Name - [Arguments] ${prefix}=CSIT_ - ${random}= Generate Random String 15 [LOWER][NUMBERS] - ${policyname}= Catenate ${prefix}${random} - [Return] ${policyname} - -Create Ops VFW Policy - [Documentation] Create Operational Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_vFirewall - ${OPS_POLICY_VFW_NAME}= Set Test Variable ${policyname1} - ${dict}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_OPS_VFW_TEMPLATE} ${dict} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Log ${put_resp} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Push Ops Policy - [Documentation] Push Ops Policy - [Arguments] ${policyname} ${policytype} - Create Environment policy ${CURDIR} - ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} - ${output} = Apply Template policy ${PUSH_POLICY_TEMPLATE} ${dict} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - -Push Config Policy - [Documentation] Push Config Policy - [Arguments] ${policyname} ${policytype} - Create Environment policy ${CURDIR} - ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} - ${output} = Apply Template policy ${PUSH_POLICY_TEMPLATE} ${dict} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - -Delete Ops Policy - [Documentation] Delete Config Policy - [Arguments] ${policy_name} - Create Environment policy ${CURDIR} - ${policyname3}= Catenate com.Config_BRMS_Param_${policyname}.1.xml - ${dict}= Create Dictionary policy_name=${policyname3} - ${output} = Apply Template policy ${DEL_POLICY_TEMPLATE} ${dict} - ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - -Delete Config Policy - [Documentation] Delete Ops Policy - [Arguments] ${policy_name} - Create Environment policy ${CURDIR} - ${policyname3}= Catenate com.Config_MS_com.${policy_name}.1.xml - ${dict}= Create Dictionary policy_name=${policyname3} - ${output} = Apply Template policy ${DEL_POLICY_TEMPLATE} ${dict} - ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - -Delete OOF Policy - [Documentation] Delete OOF Policy - [Arguments] ${policy_name} - Create Environment policy ${CURDIR} - ${policyname3}= Catenate com.Config_OOF_${policy_name}.1.xml - ${dict}= Create Dictionary policy_name=${policyname3} - ${output} = Apply Template policy ${DEL_POLICY_TEMPLATE} ${dict} - ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - -Get Configs VDNS Policy - [Documentation] Get Config Policy for VDNS - Create Environment policy ${CURDIR} - ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VDNS_NAME}* - ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} - ${output} = Apply Template policy ${GETCONFIG_TEMPLATE} ${configpolicy_name} - ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} - Should Be Equal As Strings ${get_resp.status_code} 200 - -Create Config VDNS Policy - [Documentation] Create Config Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_vLoadBalancer - ${CONFIG_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} - ${configpolicy}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_CONFIG_VDNS_TEMPLATE} ${configpolicy} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Create Ops VDNS Policy - [Documentation] Create Operational Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_vLoadBalancer - ${OPS_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} - ${dict}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_OPS_VDNS_TEMPLATE} ${dict} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Log ${put_resp} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Create Config VCPE Policy - [Documentation] Create Config Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_vCPE - ${CONFIG_POLICY_VCPE_NAME}= Set Test Variable ${policyname1} - ${configpolicy}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_CONFIG_VCPE_TEMPLATE} ${configpolicy} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Get Configs VCPE Policy - [Documentation] Get Config Policy for VCPE - Create Environment policy ${CURDIR} - ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VCPE_NAME}* - ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} - ${output} = Apply Template policy ${GETCONFIG_TEMPLATE} ${configpolicy_name} - ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} - Should Be Equal As Strings ${get_resp.status_code} 200 - -Create Ops vCPE Policy - [Documentation] Create Operational Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_vCPE - ${OPS_POLICY_VCPE_NAME}= Set Test Variable ${policyname1} - ${dict}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_OPS_VCPE_TEMPLATE} ${dict} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Log ${put_resp} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Create Ops VolTE Policy - [Documentation] Create Operational Policy - Create Environment policy ${CURDIR} - ${randompolicyname} = Create Policy Name - ${policyname1}= Catenate com.${randompolicyname}_VoLTE - ${dict}= Create Dictionary policy_name=${policyname1} - ${output} = Apply Template policy ${CREATE_OPS_VOLTE_TEMPLATE} ${dict} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} - Log ${put_resp} - Should Be Equal As Strings ${put_resp.status_code} 200 - [Return] ${policyname1} - -Upload DRL file - [Documentation] Upload DRL file1 - ${file_data}= Get Binary File ${file_path} - ${files}= Create Dictionary file=${file_data} - #${CONFIG_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} - # ${files2} = {'file': open('../testsuite/robot/assets/templates/ControlLoopDemo__closedLoopControlName.drl', 'rb')} - # ${files}= Create Dictionary file ${file_data} - ${put_resp} = Run Policy Post form Request ${RESOURCE_PATH_UPLOAD} ${files} - Should Be Equal As Strings ${put_resp.status_code} 200 - -ListPolicy test - [Documentation] Listing Config Policies - [Arguments] ${policy_name} - Create Environment policy ${CURDIR} - ${dict}= Create Dictionary policy_name=${policy_name} - ${output} = Apply Template policy ${LISTPOLICY_TEMPLATE} ${dict} - ${put_resp} = policy_interface.Run Policy Post Request ${RESOURCE_PATH_LISTPOLICY} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - -Push Multiple Policy test - [Documentation] Push Multiple Policy - [Arguments] ${policyname1} ${policyname2} ${policyname3} ${policytype} - Create Environment policy ${CURDIR} - ${dict}= Create Dictionary policy_name1=${policyname1} policy_name2=${policyname2} policy_name3=${policyname3} policy_type=${policytype} - ${output} = Apply Template policy ${MULTIPLE_PUSH_POLICY_TEMPLATE} ${dict} - ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - -Delete Multiple Policy test - [Documentation] Delete Multiple Policy - [Arguments] ${policyname1} ${policyname2} ${policyname3} ${policytype} - Create Environment policy ${CURDIR} - ${dict}= Create Dictionary policy_name1=${policyname1} policy_name2=${policyname2} policy_name3=${policyname3} policy_type=${policytype} - ${output} = Apply Template policy ${MULTIPLE_UNPUSH_POLICY_TEMPLATE} ${dict} - ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} - Should Be Equal As Strings ${put_resp.status_code} 200 - diff --git a/tests/policy/engine/__init__.robot b/tests/policy/engine/__init__.robot deleted file mode 100644 index c7970e6a..00000000 --- a/tests/policy/engine/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -*** Settings *** -Documentation Policy - Suite 1 diff --git a/tests/policy/engine/configpolicy_vCPE_R1.jinja b/tests/policy/engine/configpolicy_vCPE_R1.jinja deleted file mode 100644 index 6bcd74fe..00000000 --- a/tests/policy/engine/configpolicy_vCPE_R1.jinja +++ /dev/null @@ -1,7 +0,0 @@ -{ - "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevCPE\", \"description\": \"MicroService vCPE Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"policyVersion\": \"v0.0.1\", \"threshholds\": [{ \"severity\": \"MAJOR\", \"fieldPath\": \"$$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": \"0\", \"closedLoopEventStatus\": \"ABATED\", \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"direction\": \"EQUAL\" }, { \"severity\": \"CRITICAL\", \"fieldPath\": \"$$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": \"0\", \"closedLoopEventStatus\": \"ONSET\", \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"direction\": \"GREATER\" }], \"policyName\": \"DCAE.Config_tca-hi-lo\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"eventName\": \"Measurement_vGMUX\" } }", - "policyConfigType": "MicroService", - "policyName": "{{policy_name}}", - "onapName": "DCAE", - "priority": "5" -} diff --git a/tests/policy/engine/configpolicy_vDNS_R1.jinja b/tests/policy/engine/configpolicy_vDNS_R1.jinja deleted file mode 100644 index a2c3eeb9..00000000 --- a/tests/policy/engine/configpolicy_vDNS_R1.jinja +++ /dev/null @@ -1,7 +0,0 @@ -{ - "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevDNS\", \"description\": \"MicroService vDNS Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"policyVersion\": \"v0.0.1\", \"threshholds\": [{ \"severity\": \"CRITICAL\", \"fieldPath\": \"$$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": \"300\", \"closedLoopEventStatus\": \"ONSET\", \"closedLoopControlName\": \"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\", \"version\": \"1.0.2\", \"direction\": \"GREATER_OR_EQUAL\" }], \"policyName\": \"DCAE.Config_tca-hi-lo\", \"controlLoopSchemaType\": \"VM\", \"policyScope\": \"DCAE\", \"eventName\": \"vLoadBalancer\" } }", - "policyConfigType": "MicroService", - "policyName": "{{policy_name}}", - "onapName": "DCAE", - "priority": "5" -} diff --git a/tests/policy/engine/configpolicy_vFW_R1.jinja b/tests/policy/engine/configpolicy_vFW_R1.jinja deleted file mode 100644 index b843a0b0..00000000 --- a/tests/policy/engine/configpolicy_vFW_R1.jinja +++ /dev/null @@ -1,7 +0,0 @@ -{ - "configBody": "{\"service\": \"tca_policy\",\"location\": \"SampleServiceLocation\",\"uuid\": \"test\",\"policyName\": \"MicroServicevFirewall\",\"description\": \"MicroService vFirewall Policy\",\"configName\": \"SampleConfigName\",\"templateVersion\": \"OpenSource.version.1\",\"version\": \"1.1.0\",\"priority\": \"1\",\"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"riskType\": \"SampleRiskType\",\"riskLevel\": \"1\",\"guard\": \"False\",\"content\": {\"policyVersion\": \"v0.0.1\",\"threshholds\": [{\"severity\": \"MAJOR\",\"fieldPath\": \"$$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\": \"300\",\"closedLoopEventStatus\": \"ONSET\",\"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\": \"1.0.2\",\"direction\": \"LESS_OR_EQUAL\"}, {\"severity\": \"CRITICAL\",\"fieldPath\": \"$$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\": \"700\",\"closedLoopEventStatus\": \"ONSET\",\"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\": \"1.0.2\",\"direction\": \"GREATER_OR_EQUAL\"}],\"policyName\": \"DCAE.Config_tca-hi-lo\",\"controlLoopSchemaType\": \"VNF\",\"policyScope\": \"DCAE\",\"eventName\": \"vFirewallBroadcastPackets\"}}", - "policyConfigType": "MicroService", - "policyName": "{{policy_name}}", - "onapName": "DCAE", - "priority": "5" -} diff --git a/tests/policy/engine/createpolicy.jinja b/tests/policy/engine/createpolicy.jinja deleted file mode 100644 index bbb1f1ad..00000000 --- a/tests/policy/engine/createpolicy.jinja +++ /dev/null @@ -1,21 +0,0 @@ -{ - "policyConfigType": "BRMS_PARAM", - "policyName": "{{policy_name}}", - "policyDescription": "Create BRMS Param policy", - "attributes": { - "RULE": { - "templateName": "ClosedLoopDemo_closedLoopControlName", - "aaiNamedQueryUUID": "2", - "aaiPassword": "2", - "aaiPatternMatch": "2", - "aaiURL": "2", - "actor": "2", - "appcTopic": "2", - "closedLoopControlName": "2", - "msoPassword": "2", - "msoURL": "2", - "msoUsername": "2", - "aaiUsername": "3" - } - } -} diff --git a/tests/policy/engine/deletepolicy.jinja b/tests/policy/engine/deletepolicy.jinja deleted file mode 100644 index 73c5badf..00000000 --- a/tests/policy/engine/deletepolicy.jinja +++ /dev/null @@ -1,5 +0,0 @@ -{ - "pdpGroup": "default", - "policyComponent": "PDP", - "policyName": "{{policy_name}}" -} diff --git a/tests/policy/engine/getconfigpolicy.jinja b/tests/policy/engine/getconfigpolicy.jinja deleted file mode 100644 index 11e8cae6..00000000 --- a/tests/policy/engine/getconfigpolicy.jinja +++ /dev/null @@ -1,8 +0,0 @@ -{ - "configAttributes" : { - }, - "configName" : ".*", - "ecompName" : "DCAE", - "policyName" : "{{config_policy_name}}", - "unique" : false -} \ No newline at end of file diff --git a/tests/policy/engine/getoofpolicy.jinja b/tests/policy/engine/getoofpolicy.jinja deleted file mode 100644 index 3c7dd755..00000000 --- a/tests/policy/engine/getoofpolicy.jinja +++ /dev/null @@ -1,6 +0,0 @@ -{ - "configAttributes" : { - }, - "policyName" : "{{oof_policy_name}}", - "unique" : false -} diff --git a/tests/policy/engine/global_properties.robot b/tests/policy/engine/global_properties.robot deleted file mode 100644 index e0c816ea..00000000 --- a/tests/policy/engine/global_properties.robot +++ /dev/null @@ -1,30 +0,0 @@ -*** Settings *** -Documentation store all properties that can change or are used in multiple places here -... format is all caps with underscores between words and prepended with GLOBAL -... make sure you prepend them with GLOBAL so that other files can easily see it is from this file. - - -*** Variables *** -${GLOBAL_APPLICATION_ID} robot-ete -${GLOBAL_MSO_STATUS_PATH} /ecomp/mso/infra/orchestrationRequests/v2/ -${GLOBAL_SELENIUM_BROWSER} chrome -${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} Create Dictionary -${GLOBAL_SELENIUM_DELAY} 0 -${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} 5 -${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 15 -${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} orchestration -${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} volume -${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} compute -${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} network -${GLOBAL_OPENSTACK_GLANCE_SERVICE_TYPE} image -${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} identity -${GLOBAL_AAI_CLOUD_OWNER} Rackspace -${GLOBAL_BUILD_NUMBER} 31 -${GLOBAL_VM_PRIVATE_KEY} ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt -# policy info - everything is from the private oam network (also called ecomp private network) -${GLOBAL_POLICY_SERVER_URL} https://%{PDP_IP}:8081 -${GLOBAL_POLICY_AUTH} dGVzdHBkcDphbHBoYTEyMw== -${GLOBAL_POLICY_CLIENTAUTH} cHl0aG9uOnRlc3Q= -${GLOBAL_POLICY_HEALTHCHECK_URL} https://%{POLICY_IP}:6969 -${GLOBAL_POLICY_USERNAME} demo@people.osaaf.org -${GLOBAL_POLICY_PASSWORD} demo123456! diff --git a/tests/policy/engine/listpolicy.jinja b/tests/policy/engine/listpolicy.jinja deleted file mode 100644 index ce2d3df0..00000000 --- a/tests/policy/engine/listpolicy.jinja +++ /dev/null @@ -1,3 +0,0 @@ -{ - "policyName": "{{policy_name}}" -} diff --git a/tests/policy/engine/multiple_pushpolicy.jinja b/tests/policy/engine/multiple_pushpolicy.jinja deleted file mode 100644 index bda0da08..00000000 --- a/tests/policy/engine/multiple_pushpolicy.jinja +++ /dev/null @@ -1,5 +0,0 @@ -{ - "policyName":"{{policy_name1}},{{policy_name2}},{{policy_name3}}", - "policyType":"{{policy_type}}", - "pdpGroup":"default" -} diff --git a/tests/policy/engine/multiple_unpushpolicy.jinja b/tests/policy/engine/multiple_unpushpolicy.jinja deleted file mode 100644 index 55fb8810..00000000 --- a/tests/policy/engine/multiple_unpushpolicy.jinja +++ /dev/null @@ -1,6 +0,0 @@ -{ - "policyName": "{{policy_name1}},{{policy_name2}},{{policy_name3}}", - "policyType": "{{policy_type}}", - "policyComponent": "PDP", - "pdpGroup": "default" -} diff --git a/tests/policy/engine/oofpolicy_HPA_R1.jinja b/tests/policy/engine/oofpolicy_HPA_R1.jinja deleted file mode 100644 index 6834ceb6..00000000 --- a/tests/policy/engine/oofpolicy_HPA_R1.jinja +++ /dev/null @@ -1,6 +0,0 @@ -{ - "configBody": "{\"service\":\"hpaPolicy\",\"policyName\":\"testWorkingTOSCA\",\"description\":\"testing\",\"templateVersion\":\"OpenSource.version.1\",\"version\":\"CSIT\",\"priority\":\"5\",\"riskType\":\"SampleRiskType\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"identity\":\"testIdentity\",\"policyScope\":[\"test1\",\"test2\",\"test3\"],\"policyType\":\"hpaPolicy\",\"resources\":\"testResources1\",\"flavorFeatures\":[{\"flavorLabel\":\"testFlavor\",\"flavorProperties\":[{\"score\":\"testScore\",\"featureAttributes\":[{\"unit\":\"testUnit\",\"attribute\":\"teatFeatureAttribute\",\"value\":\"testValue\",\"operator\":\"any\"}],\"mandatory\":\"testMandatory\",\"hpaFeature\":\"testHAPFeature\",\"architecture\":\"testArch\"}]}]}}", - "policyConfigType": "Optimization", - "policyName": "{{policy_name}}", - "onapName": "OOF" -} diff --git a/tests/policy/engine/opspolicy_VDNS_R1.jinja b/tests/policy/engine/opspolicy_VDNS_R1.jinja deleted file mode 100644 index 8b1e6d2d..00000000 --- a/tests/policy/engine/opspolicy_VDNS_R1.jinja +++ /dev/null @@ -1,16 +0,0 @@ -{ - "policyConfigType": "BRMS_PARAM", - "policyName": "{{policy_name}}", - "policyDescription": "BRMS Param vDNS policy", - "policyScope": "com", - "attributes": { - "MATCHING": { - "controller" : "amsterdam" - }, - "RULE": { - "templateName": "ClosedLoopControlName", - "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0D%0A++trigger_policy%3A+unique-policy-id-1-scale-up%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-scale-up%0D%0A++++name%3A+Create+a+new+VF+Module%0D%0A++++description%3A%0D%0A++++actor%3A+SO%0D%0A++++recipe%3A+VF+Module+Create%0D%0A++++target%3A%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" - } - } -} \ No newline at end of file diff --git a/tests/policy/engine/opspolicy_VFW_R1.jinja b/tests/policy/engine/opspolicy_VFW_R1.jinja deleted file mode 100644 index 0a6977df..00000000 --- a/tests/policy/engine/opspolicy_VFW_R1.jinja +++ /dev/null @@ -1,16 +0,0 @@ -{ - "policyConfigType": "BRMS_PARAM", - "policyName": "{{policy_name}}", - "policyDescription": "BRMS Param vFirewall policy", - "policyScope": "com", - "attributes": { - "MATCHING": { - "controller" : "amsterdam" - }, - "RULE": { - "templateName": "ClosedLoopControlName", - "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0D%0A++trigger_policy%3A+unique-policy-id-1-modifyConfig%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-modifyConfig%0D%0A++++name%3A+modify+packet+gen+config%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+ModifyConfig%0D%0A++++target%3A%0D%0A++++++%23+TBD+-+Cannot+be+known+until+instantiation+is+done%0D%0A++++++resourceID%3A+Eace933104d443b496b8.nodes.heat.vpg%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+300%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" - } - } -} diff --git a/tests/policy/engine/opspolicy_vCPE_R1.jinja b/tests/policy/engine/opspolicy_vCPE_R1.jinja deleted file mode 100644 index a04a0c1e..00000000 --- a/tests/policy/engine/opspolicy_vCPE_R1.jinja +++ /dev/null @@ -1,16 +0,0 @@ -{ - "policyConfigType": "BRMS_PARAM", - "policyName": "{{policy_name}}", - "policyDescription": "BRMS Param vCPE policy", - "policyScope": "com", - "attributes": { - "MATCHING": { - "controller" : "amsterdam" - }, - "RULE": { - "templateName": "ClosedLoopControlName", - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+true%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-restart%0D%0A++++name%3A+Restart+the+VM%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+Restart%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" - } - } -} \ No newline at end of file diff --git a/tests/policy/engine/opspolicy_vOLTE_R1.jinja b/tests/policy/engine/opspolicy_vOLTE_R1.jinja deleted file mode 100644 index 67119659..00000000 --- a/tests/policy/engine/opspolicy_vOLTE_R1.jinja +++ /dev/null @@ -1,16 +0,0 @@ -{ - "policyConfigType": "BRMS_PARAM", - "policyName": "{{policy_name}}", - "policyDescription": "BRMS Param VOLTE policy", - "policyScope": "com", - "attributes": { - "MATCHING": { - "controller" : "amsterdam" - }, - "RULE": { - "templateName": "ClosedLoopControlName", - "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-restart%0D%0A++++name%3A+Restart+the+VM%0D%0A++++description%3A%0D%0A++++actor%3A+VFC%0D%0A++++recipe%3A+Restart%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard" - } - } -} \ No newline at end of file diff --git a/tests/policy/engine/policy_interface.robot b/tests/policy/engine/policy_interface.robot deleted file mode 100644 index da7fdd87..00000000 --- a/tests/policy/engine/policy_interface.robot +++ /dev/null @@ -1,66 +0,0 @@ -*** Settings *** -Documentation The main interface for interacting with Policy. It handles low level stuff like managing the http request library and Policy required fields -Library RequestsLibrary -Library String -Library Collections -Resource global_properties.robot - -*** Variables *** -${POLICY_HEALTH_CHECK_PATH} /healthcheck - -*** Keywords *** - -Run Policy Health Check - [Documentation] Runs Policy Health check - ${auth}= Create List ${GLOBAL_POLICY_USERNAME} ${GLOBAL_POLICY_PASSWORD} - Log Creating session ${GLOBAL_POLICY_SERVER_URL} - ${session}= Create Session policy ${GLOBAL_POLICY_HEALTHCHECK_URL} auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy ${POLICY_HEALTH_CHECK_PATH} headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be True ${resp.json()['healthy']} - @{ITEMS}= Copy List ${resp.json()['details']} - :FOR ${ELEMENT} IN @{ITEMS} - \ Should Be Equal As Strings ${ELEMENT['code']} 200 - \ Should Be True ${ELEMENT['healthy']} - -Run Policy Put Request - [Documentation] Runs Policy Put request - [Arguments] ${data_path} ${data} - Log Creating session ${GLOBAL_POLICY_SERVER_URL} - ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_URL} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST - ${resp}= Put Request policy ${data_path} data=${data} headers=${headers} - Log Received response from policy ${resp.text} - [Return] ${resp} - -Run Policy Post Request - [Documentation] Runs Policy Post request - [Arguments] ${data_path} ${data} - Log Creating session ${GLOBAL_POLICY_SERVER_URL} - ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_URL} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST - ${resp}= Post Request policy ${data_path} data=${data} headers=${headers} - Log Received response from policy ${resp.text} - [Return] ${resp} - -Run Policy Delete Request - [Documentation] Runs Policy Delete request - [Arguments] ${data_path} ${data} - Log Creating session ${GLOBAL_POLICY_SERVER_URL} - ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_URL} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST - ${resp}= Delete Request policy ${data_path} data=${data} headers=${headers} - Log Received response from policy ${resp.text} - [Return] ${resp} - -Run Policy Get Configs Request - [Documentation] Runs Policy Get Configs request - [Arguments] ${data_path} ${data} - Log Creating session ${GLOBAL_POLICY_SERVER_URL} - ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_URL} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} - ${resp}= Post Request policy ${data_path} data=${data} headers=${headers} - Log Received response from policy ${resp.text} - [Return] ${resp} diff --git a/tests/policy/engine/pushpolicy.jinja b/tests/policy/engine/pushpolicy.jinja deleted file mode 100644 index a1faaede..00000000 --- a/tests/policy/engine/pushpolicy.jinja +++ /dev/null @@ -1,5 +0,0 @@ -{ - "policyName":"{{policy_name}}", - "policyType":"{{policy_type}}", - "pdpGroup":"default" -} \ No newline at end of file diff --git a/tests/policy/engine/sdncnamingpolicy_vFW.jinja b/tests/policy/engine/sdncnamingpolicy_vFW.jinja deleted file mode 100644 index a012d59c..00000000 --- a/tests/policy/engine/sdncnamingpolicy_vFW.jinja +++ /dev/null @@ -1,11 +0,0 @@ -{ - "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VFW_NAMING_TIMESTAMP\",\"naming-models\":[{\"naming-properties\":[{\"property-name\":\"AIC_CLOUD_REGION\"},{\"property-name\":\"nfRole\"},{\"property-name\":\"TIMESTAMP\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNF\",\"nfRole\":\"vFW\",\"naming-recipe\":\"AIC_CLOUD_REGION|DELIMITER|nfRole|DELIMITER|TIMESTAMP\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"ENTIRETY\",\"start-value\":\"001\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}},{\"property-name\":\"NFC_NAMING_CODE\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNFC\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"},{\"property-name\":\"VF_MODULE_LABEL\"},{\"property-name\":\"VF_MODULE_TYPE\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"PRECEEDING\",\"start-value\":\"01\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}}],\"naming-type\":\"VF-MODULE\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"protected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"protected_private_net_id\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"unprotected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"unprotected_private_net_id\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", - "policyName": "{{policy_name}}", - "policyConfigType": "MicroService", - "onapName": "SDNC", - "riskLevel": "4", - "riskType": "test", - "guard": "false", - "priority": "4", - "description": "ONAP_VFW_NAMING_TIMESTAMP" -} \ No newline at end of file diff --git a/tests/policy/engine/sdncnamingpolicy_vPG.jinja b/tests/policy/engine/sdncnamingpolicy_vPG.jinja deleted file mode 100644 index 9aa4f505..00000000 --- a/tests/policy/engine/sdncnamingpolicy_vPG.jinja +++ /dev/null @@ -1,11 +0,0 @@ -{ - "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VPG_NAMING_TIMESTAMP\",\"naming-models\":[{\"naming-properties\":[{\"property-name\":\"AIC_CLOUD_REGION\"},{\"property-name\":\"nfRole\"},{\"property-name\":\"TIMESTAMP\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNF\",\"nfRole\":\"vPG\",\"naming-recipe\":\"AIC_CLOUD_REGION|DELIMITER|nfRole|DELIMITER|TIMESTAMP\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"ENTIRETY\",\"start-value\":\"001\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}},{\"property-name\":\"NFC_NAMING_CODE\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNFC\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"},{\"property-name\":\"VF_MODULE_LABEL\"},{\"property-name\":\"VF_MODULE_TYPE\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"PRECEEDING\",\"start-value\":\"01\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}}],\"naming-type\":\"VF-MODULE\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"protected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"protected_private_net_id\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"unprotected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"unprotected_private_net_id\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", "policyName": "{{policy_name}}", - "policyName": "{{policy_name}}", - "policyConfigType": "MicroService", - "onapName": "SDNC", - "riskLevel": "4", - "riskType": "test", - "guard": "false", - "priority": "4", - "description": "ONAP_VPG_NAMING_TIMESTAMP" -} \ No newline at end of file -- 2.16.6