aboutsummaryrefslogtreecommitdiffstats
path: root/plans
diff options
context:
space:
mode:
Diffstat (limited to 'plans')
-rwxr-xr-xplans/ccsdk-oran/polmansuite/FTC1.sh13
-rwxr-xr-xplans/ccsdk-oran/polmansuite/FTC150.sh6
-rwxr-xr-xplans/ccsdk-oran/polmansuite/setup.sh4
-rw-r--r--plans/ccsdk-oran/polmansuite/test_env-guilin.sh147
-rw-r--r--plans/ccsdk-oran/polmansuite/test_env-master.sh (renamed from plans/ccsdk-oran/polmansuite/test_env.sh)0
-rw-r--r--plans/policy/apex-pdp/setup.sh52
-rw-r--r--plans/policy/apex-pdp/teardown.sh7
-rw-r--r--plans/policy/api/setup.sh24
-rwxr-xr-xplans/policy/api/teardown.sh5
-rw-r--r--plans/policy/distribution/setup.sh59
-rw-r--r--plans/policy/distribution/teardown.sh8
-rwxr-xr-xplans/policy/drools-applications/setup.sh38
-rwxr-xr-xplans/policy/drools-applications/teardown.sh4
-rwxr-xr-xplans/policy/drools-pdp/setup.sh25
-rwxr-xr-xplans/policy/drools-pdp/teardown.sh4
-rw-r--r--plans/policy/pap/setup.sh32
-rw-r--r--plans/policy/pap/teardown.sh6
-rw-r--r--plans/policy/xacml-pdp/setup.sh45
-rw-r--r--plans/policy/xacml-pdp/teardown.sh8
-rw-r--r--plans/vnfsdk-marketplace/sanity-check/setup.sh30
-rw-r--r--plans/vnfsdk-marketplace/testsuites/docker-compose.yml43
-rw-r--r--plans/vnfsdk-marketplace/testsuites/enterprise2DC.csar (renamed from plans/vnfsdk-marketplace/sanity-check/enterprise2DC.csar)bin4622 -> 4622 bytes
-rw-r--r--plans/vnfsdk-marketplace/testsuites/setup.sh (renamed from plans/vnfsdk-refrepo/sanity-check/setup.sh)28
-rw-r--r--plans/vnfsdk-marketplace/testsuites/teardown.sh (renamed from plans/vnfsdk-marketplace/sanity-check/teardown.sh)5
-rw-r--r--plans/vnfsdk-marketplace/testsuites/testplan.txt (renamed from plans/vnfsdk-marketplace/sanity-check/testplan.txt)0
-rw-r--r--plans/vnfsdk-marketplace/testsuites/uploadCSAR.sh (renamed from plans/vnfsdk-marketplace/sanity-check/uploadCSAR.sh)0
-rw-r--r--plans/vnfsdk-refrepo/sanity-check/enterprise2DC.csarbin4622 -> 0 bytes
-rw-r--r--plans/vnfsdk-refrepo/sanity-check/uploadCSAR.sh138
-rw-r--r--plans/vnfsdk-refrepo/testsuites/setup.sh43
-rw-r--r--plans/vnfsdk-refrepo/testsuites/teardown.sh (renamed from plans/vnfsdk-refrepo/sanity-check/teardown.sh)4
-rw-r--r--plans/vnfsdk-refrepo/testsuites/testplan.txt (renamed from plans/vnfsdk-refrepo/sanity-check/testplan.txt)2
31 files changed, 337 insertions, 443 deletions
diff --git a/plans/ccsdk-oran/polmansuite/FTC1.sh b/plans/ccsdk-oran/polmansuite/FTC1.sh
index 26398d55..1ccb425e 100755
--- a/plans/ccsdk-oran/polmansuite/FTC1.sh
+++ b/plans/ccsdk-oran/polmansuite/FTC1.sh
@@ -20,8 +20,8 @@
TC_ONELINE_DESCR="Sanity test, create service and then create,update and delete a policy using http/https and Agent REST/DMAAP with/without SDNC controller"
-#App names to exclude checking pulling images for, space separated list
-EXCLUDED_IMAGES="SDNC SDNC_ONAP"
+#App names to include in the test, space separated list
+INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC"
. ../common/testcase_common.sh $@
. ../common/agent_api_functions.sh
@@ -32,15 +32,6 @@ EXCLUDED_IMAGES="SDNC SDNC_ONAP"
generate_uuid
-####################################
-####################################
-######## LIMITED TEST SCOPE ########
-######## THIS FILE SHALL ########
-######## BE REMOVED WHEN ########
-######## THE SDNC IMAGE ########
-######## IS OK ########
-####################################
-####################################
# Tested variants of REST/DMAAP/SDNC config
TESTED_VARIANTS="REST DMAAP"
#Test agent and simulator protocol versions (others are http only)
diff --git a/plans/ccsdk-oran/polmansuite/FTC150.sh b/plans/ccsdk-oran/polmansuite/FTC150.sh
index b65b3a5f..c6c690d1 100755
--- a/plans/ccsdk-oran/polmansuite/FTC150.sh
+++ b/plans/ccsdk-oran/polmansuite/FTC150.sh
@@ -20,8 +20,8 @@
TC_ONELINE_DESCR="Sample tests of the SDNC A1 controller restconf API using http/https (no agent)"
-#App names to exclude checking pulling images for, space separated list
-EXCLUDED_IMAGES="PA CP SDNC_ONAP"
+#App names to include in the test, space separated list
+INCLUDED_IMAGES="RICSIM SDNC"
. ../common/testcase_common.sh $@
. ../common/controller_api_functions.sh
@@ -32,7 +32,7 @@ EXCLUDED_IMAGES="PA CP SDNC_ONAP"
generate_uuid
#Test agent and simulator protocol versions (others are http only)
-NB_TESTED_PROTOCOLS="HTTP"
+NB_TESTED_PROTOCOLS="HTTP HTTPS"
SB_TESTED_PROTOCOLS="HTTP HTTPS"
for __nb_httpx in $NB_TESTED_PROTOCOLS ; do
diff --git a/plans/ccsdk-oran/polmansuite/setup.sh b/plans/ccsdk-oran/polmansuite/setup.sh
index 10fed96f..b02d9db3 100755
--- a/plans/ccsdk-oran/polmansuite/setup.sh
+++ b/plans/ccsdk-oran/polmansuite/setup.sh
@@ -28,6 +28,8 @@ POLMAN_PLANS=$WORKSPACE/plans/ccsdk-oran/polmansuite
cp $POLMAN_PLANS/FTC1.sh $WORKSPACE/archives/nonrtric/test/auto-test/FTC1.sh
cp $POLMAN_PLANS/FTC150.sh $WORKSPACE/archives/nonrtric/test/auto-test/FTC150.sh
+TEST_ENV=$POLMAN_PLANS/test_env-${GERRIT_BRANCH}.sh
+
#Make the env vars availble to the robot scripts
-ROBOT_VARIABLES="-b debug.log -v AUTOTEST_ROOT:${AUTOTEST_ROOT} -v POLMAN_PLANS:${POLMAN_PLANS}"
+ROBOT_VARIABLES="-b debug.log -v AUTOTEST_ROOT:${AUTOTEST_ROOT} -v TEST_ENV:${TEST_ENV}"
diff --git a/plans/ccsdk-oran/polmansuite/test_env-guilin.sh b/plans/ccsdk-oran/polmansuite/test_env-guilin.sh
new file mode 100644
index 00000000..e7a90303
--- /dev/null
+++ b/plans/ccsdk-oran/polmansuite/test_env-guilin.sh
@@ -0,0 +1,147 @@
+#!/bin/bash
+
+# ============LICENSE_START===============================================
+# Copyright (C) 2020 Nordix Foundation. 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=================================================
+#
+
+# Set up the image and tags for the test. Do not add the image tag to the image names.
+
+# NOTE: A env var for each container is created by the test script.
+# This var will point to the local or remote var depending on how
+# the test script is started. The name format is <container-name>_IMAGE, ie with 'LOCAL' or 'REMOTE'.
+
+# Tag for guilin branch
+# Remote Policy Agent image and tag
+POLICY_AGENT_REMOTE_IMAGE="nexus3.onap.org:10003/onap/ccsdk-oran-a1policymanagementservice"
+POLICY_AGENT_REMOTE_IMAGE_TAG="1.0.1-SNAPSHOT"
+
+
+# Control Panel remote image and tag
+CONTROL_PANEL_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel"
+CONTROL_PANEL_REMOTE_IMAGE_TAG="2.0.0"
+
+# Tag for guilin branch
+# SDNC A1 Controller remote image and tag
+SDNC_A1_CONTROLLER_REMOTE_IMAGE="nexus3.onap.org:10003/onap/sdnc-image"
+SDNC_A1_CONTROLLER_REMOTE_IMAGE_TAG="2.0.2-STAGING-latest"
+
+
+#SDNC DB remote image and tag
+SDNC_DB_REMOTE_IMAGE="mysql/mysql-server"
+SDNC_DB_REMOTE_IMAGE_TAG="5.6"
+#No local image for DB, remote image always used
+
+
+# Near RT RIC Simulator remote image and tag
+RIC_SIM_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator"
+RIC_SIM_REMOTE_IMAGE_TAG="2.0.0"
+
+
+#Consul remote image and tag
+CONSUL_REMOTE_IMAGE="consul"
+CONSUL_REMOTE_IMAGE_TAG="1.7.2"
+#No local image for Consul, remote image always used
+
+
+#CBS remote image and tag
+CBS_REMOTE_IMAGE="nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app"
+CBS_REMOTE_IMAGE_TAG="2.3.0"
+#No local image for CBS, remote image always used
+
+
+#MR stub image and tag
+MRSTUB_LOCAL_IMAGE="mrstub"
+MRSTUB_LOCAL_IMAGE_TAG="latest"
+#No remote image for MR stub, local image always used
+
+#Callback receiver image and tag
+CR_LOCAL_IMAGE="callback-receiver"
+CR_LOCAL_IMAGE_TAG="latest"
+#No remote image for CR, local image always used
+
+# Common env var for auto-test. Vars used by docker-compose need to be exported
+export DOCKER_SIM_NWNAME="nonrtric-docker-net" # Name of docker private network
+
+export POLICY_AGENT_EXTERNAL_PORT=8081 # Policy Agent container external port (host -> container)
+export POLICY_AGENT_INTERNAL_PORT=8081 # Policy Agent container internal port (container -> container)
+export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433 # Policy Agent container external secure port (host -> container)
+export POLICY_AGENT_INTERNAL_SECURE_PORT=8433 # Policy Agent container internal secure port (container -> container)
+
+export POLICY_AGENT_APP_NAME="policy-agent" # Name for Policy Agent container
+POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log" # Path the application log in the Policy Agent container
+export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container" # Alias name, name used by the control panel
+
+export MR_EXTERNAL_PORT=3905 # MR stub container external port (host -> container)
+export MR_INTERNAL_PORT=3905 # MR stub container internal port (container -> container)
+export MR_EXTERNAL_SECURE_PORT=3906 # MR stub container external secure port (host -> container)
+export MR_INTERNAL_SECURE_PORT=3906 # MR stub container internal secure port (container -> container)
+export MR_APP_NAME="message-router" # Name for the MR
+export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR
+export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE" # Path write messages to MR
+
+export CR_EXTERNAL_PORT=8090 # Callback receiver container external port (host -> container)
+export CR_INTERNAL_PORT=8090 # Callback receiver container internal port (container -> container)
+export CR_EXTERNAL_SECURE_PORT=8091 # Callback receiver container external secure port (host -> container)
+export CR_INTERNAL_SECURE_PORT=8091 # Callback receiver container internal secure port (container -> container)
+export CR_APP_NAME="callback-receiver" # Name for the Callback receiver
+
+export CONSUL_HOST="consul-server" # Host name of consul
+export CONSUL_EXTERNAL_PORT=8500 # Consul container external port (host -> container)
+export CONSUL_INTERNAL_PORT=8500 # Consul container internal port (container -> container)
+export CONSUL_APP_NAME="polman-consul" # Name for consul container
+
+export CBS_APP_NAME="polman-cbs" # Name for CBS container
+export CBS_EXTERNAL_PORT=10000 # CBS container external port (host -> container)
+export CBS_INTERNAL_PORT=10000 # CBS container internal port (container -> container)
+export CONFIG_BINDING_SERVICE="config-binding-service" # Host name of CBS
+
+export RIC_SIM_BASE="g" # Base name of the RIC Simulator container, shall be the group code
+ # Note, a prefix is added to each container name by the .env file in the 'ric' dir
+RIC_SIM_PREFIX="ricsim" # Prefix added to ric container name, added in the .env file in the 'ric' dir
+ # This prefix can be changed from the command line
+export RIC_SIM_INTERNAL_PORT=8085 # RIC Simulator container internal port (container -> container).
+ # (external ports allocated by docker)
+export RIC_SIM_INTERNAL_SECURE_PORT=8185 # RIC Simulator container internal secure port (container -> container).
+ # (external ports allocated by docker)
+
+export SDNC_APP_NAME="a1-controller" # Name of the SNDC A1 Controller container
+export SDNC_EXTERNAL_PORT=8282 # SNDC A1 Controller container external port (host -> container)
+export SDNC_INTERNAL_PORT=8181 # SNDC A1 Controller container internal port (container -> container)
+export SDNC_EXTERNAL_SECURE_PORT=8443 # SNDC A1 Controller container external securee port (host -> container)
+export SDNC_INTERNAL_SECURE_PORT=8443 # SNDC A1 Controller container internal secure port (container -> container)
+export SDNC_DB_APP_NAME="sdnc-db" # Name of the SDNC DB container
+export SDNC_A1_TRUSTSTORE_PASSWORD="a1adapter" # SDNC truststore password
+SDNC_USER="admin" # SDNC username
+SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" # SNDC PWD
+SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:" # Base url path for SNDC API
+SDNC_ALIVE_URL="/apidoc/explorer/" # Base url path for SNDC API docs (for alive check)
+SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log" # Path to karaf log
+
+
+export CONTROL_PANEL_APP_NAME="control-panel" # Name of the Control Panel container
+export CONTROL_PANEL_EXTERNAL_PORT=8080 # Control Panel container external port (host -> container)
+export CONTROL_PANEL_INTERNAL_PORT=8080 # Control Panel container external port (host -> container)
+CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log" # Path the application log in the Control Panel container
+
+UUID="" # UUID used as prefix to the policy id to simulate a real UUID
+ # Testscript need to set the UUID to use other this empty prefix is used
+
+RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT # Base url to the Agent NB REST interface
+RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface
+DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT # Base url to the Dmaap adapter, http
+DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT # Base url to the Dmaap adapter, https
+ADAPTER=$RESTBASE # Adapter holds the address the agent R-APP interface (REST OR DMAAP)
+ # The values of this var is swiched between the two base url when needed
diff --git a/plans/ccsdk-oran/polmansuite/test_env.sh b/plans/ccsdk-oran/polmansuite/test_env-master.sh
index 874c8bd7..874c8bd7 100644
--- a/plans/ccsdk-oran/polmansuite/test_env.sh
+++ b/plans/ccsdk-oran/polmansuite/test_env-master.sh
diff --git a/plans/policy/apex-pdp/setup.sh b/plans/policy/apex-pdp/setup.sh
index d3c1d629..02238e90 100644
--- a/plans/policy/apex-pdp/setup.sh
+++ b/plans/policy/apex-pdp/setup.sh
@@ -20,55 +20,17 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
source ${SCRIPTS}/policy/config/policy-csit.conf
-export POLICY_MARIADB_VER
-echo ${GERRIT_BRANCH}
-echo ${POLICY_MARIADB_VER}
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
pip uninstall -y docker
pip install -U docker==2.7.0
-# 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
-
sudo apt-get -y install libxml2-utils
-bash ${SCRIPTS}/policy/policy-models-dmaap-sim.sh
-POLICY_API_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_API_VERSION="${POLICY_API_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_PAP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_PAP_VERSION="${POLICY_PAP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_APEX_PDP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/apex-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_APEX_PDP_VERSION="${POLICY_APEX_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
+source ${SCRIPTS}/policy/detmVers.sh
-echo ${POLICY_API_VERSION}
-echo ${POLICY_PAP_VERSION}
-echo ${POLICY_APEX_PDP_VERSION}
-
-# Adding this waiting container due to race condition between pap and mariadb
-docker-compose -f ${WORKSPACE}/scripts/policy/policy-apex-pdp/docker-compose-apex.yml run --rm start_dependencies
-
-#Configure the database
-docker exec --tty mariadb chmod +x /docker-entrypoint-initdb.d/db.sh
-docker exec --tty mariadb /docker-entrypoint-initdb.d/db.sh
-
-# now bring everything else up
-docker-compose -f ${WORKSPACE}/scripts/policy/policy-apex-pdp/docker-compose-apex.yml run --rm start_all
+docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d apex-pdp
unset http_proxy https_proxy
@@ -76,7 +38,7 @@ POLICY_API_IP=`get-instance-ip.sh policy-api`
POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
MARIADB_IP=`get-instance-ip.sh mariadb`
APEX_IP=`get-instance-ip.sh policy-apex-pdp`
-DMAAP_IP=`get-instance-ip.sh dmaap-simulator`
+DMAAP_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org`
echo PAP IP IS ${POLICY_PAP_IP}
echo MARIADB IP IS ${MARIADB_IP}
@@ -84,4 +46,10 @@ echo API IP IS ${POLICY_API_IP}
echo APEX IP IS ${APEX_IP}
echo DMAAP_IP IS ${DMAAP_IP}
-ROBOT_VARIABLES="-v APEX_IP:${APEX_IP} -v POLICY_API_IP:${POLICY_API_IP} -v POLICY_PAP_IP:${POLICY_PAP_IP}"
+# wait for the app to start up
+${SCRIPTS}/policy/wait_for_port.sh ${APEX_IP} 6969
+
+ROBOT_VARIABLES=""
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}"
diff --git a/plans/policy/apex-pdp/teardown.sh b/plans/policy/apex-pdp/teardown.sh
index 6c02aea1..86416e6e 100644
--- a/plans/policy/apex-pdp/teardown.sh
+++ b/plans/policy/apex-pdp/teardown.sh
@@ -3,6 +3,7 @@
# Copyright (C) 2018 Ericsson. All rights reserved.
#
# Modifications copyright (c) 2019 Nordix Foundation.
+# Modifications Copyright (C) 2020 AT&T Intellectual Property.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,8 +20,4 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-kill-instance.sh policy-apex-pdp
-kill-instance.sh policy-pap
-kill-instance.sh policy-api
-kill-instance.sh mariadb
-kill-instance.sh dmaap-simulator
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v
diff --git a/plans/policy/api/setup.sh b/plans/policy/api/setup.sh
index b75b492a..550337e9 100644
--- a/plans/policy/api/setup.sh
+++ b/plans/policy/api/setup.sh
@@ -19,9 +19,6 @@
# Select branch
source ${SCRIPTS}/policy/config/policy-csit.conf
-export POLICY_MARIADB_VER
-echo ${GERRIT_BRANCH}
-echo ${POLICY_MARIADB_VER}
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
@@ -30,14 +27,9 @@ pip install -U docker==2.7.0
sudo apt-get -y install libxml2-utils
-POLICY_API_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_API_VERSION="${POLICY_API_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
+bash ${SCRIPTS}/policy/get-models-examples.sh
-# download models - it contains the policy definitions
-rm -rf ${WORKSPACE}/models
-cd ${WORKSPACE}
-
-git clone --depth 1 https://gerrit.onap.org/r/policy/models -b ${GERRIT_BRANCH}
+source ${SCRIPTS}/policy/detmVers.sh
DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
@@ -53,15 +45,8 @@ sed -e 's!"version": "1.0.0"!"version": "2.0.0"!' \
echo ${POLICY_API_VERSION}
-# Adding this waiting container to avoid race condition between api and mariadb containers.
-docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-api.yml run --rm start_dependencies
-
-#Configure the database
-docker exec --tty mariadb chmod +x /docker-entrypoint-initdb.d/db.sh
-docker exec --tty mariadb /docker-entrypoint-initdb.d/db.sh
+docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d api
-# now bring everything else up
-docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-api.yml run --rm start_all
unset http_proxy https_proxy
@@ -71,6 +56,9 @@ MARIADB_IP=`get-instance-ip.sh mariadb`
echo API IP IS ${POLICY_API_IP}
echo MARIADB IP IS ${MARIADB_IP}
+# wait for the app to start up
+${SCRIPTS}/policy/wait_for_port.sh ${POLICY_API_IP} 6969
+
ROBOT_VARIABLES=""
ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
diff --git a/plans/policy/api/teardown.sh b/plans/policy/api/teardown.sh
index 0572e034..6942e353 100755
--- a/plans/policy/api/teardown.sh
+++ b/plans/policy/api/teardown.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.
@@ -17,5 +17,4 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-kill-instance.sh policy-api
-kill-instance.sh mariadb
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v
diff --git a/plans/policy/distribution/setup.sh b/plans/policy/distribution/setup.sh
index 52573b58..73226140 100644
--- a/plans/policy/distribution/setup.sh
+++ b/plans/policy/distribution/setup.sh
@@ -20,63 +20,26 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
source ${SCRIPTS}/policy/config/policy-csit.conf
-export POLICY_MARIADB_VER
-echo ${GERRIT_BRANCH}
-echo ${POLICY_MARIADB_VER}
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
pip uninstall -y docker
pip install -U docker==2.7.0
-# 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
-
sudo apt-get -y install libxml2-utils
-bash ${SCRIPTS}/policy/policy-models-dmaap-sim.sh
-POLICY_API_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_API_VERSION="${POLICY_API_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_PAP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_PAP_VERSION="${POLICY_PAP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_APEX_PDP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/apex-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_APEX_PDP_VERSION="${POLICY_APEX_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_DISTRIBUTION_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/distribution/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_DISTRIBUTION_VERSION="${POLICY_DISTRIBUTION_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
+source ${SCRIPTS}/policy/detmVers.sh
-echo ${POLICY_API_VERSION}
-echo ${POLICY_PAP_VERSION}
-echo ${POLICY_APEX_PDP_VERSION}
-echo ${POLICY_DISTRIBUTION_VERSION}
-
-SCRIPT_DIR=${WORKSPACE}/scripts/policy/policy-distribution
+SCRIPT_DIR=${SCRIPTS}/policy/policy-distribution
# Remaking the csar file in case if the file got corrupted
zip -F ${SCRIPT_DIR}/config/distribution/csar/sample_csar_with_apex_policy.csar --out ${SCRIPT_DIR}/config/distribution/csar/csar_temp.csar
-# Adding this waiting container due to race condition between pap and mariadb
-docker-compose -f ${SCRIPT_DIR}/docker-compose-distribution.yml run --rm start_dependencies
-
-#Configure the database
-docker exec --tty mariadb chmod +x /docker-entrypoint-initdb.d/db.sh
-docker exec --tty mariadb /docker-entrypoint-initdb.d/db.sh
+# Remake temp directory
+rm -rf ${SCRIPT_DIR}/config/distribution/temp
+mkdir ${SCRIPT_DIR}/config/distribution/temp
-# now bring everything else up
-docker-compose -f ${SCRIPT_DIR}/docker-compose-distribution.yml run --rm start_all
+docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d distribution
unset http_proxy https_proxy
@@ -84,7 +47,7 @@ POLICY_API_IP=`get-instance-ip.sh policy-api`
POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
MARIADB_IP=`get-instance-ip.sh mariadb`
APEX_IP=`get-instance-ip.sh policy-apex-pdp`
-DMAAP_IP=`get-instance-ip.sh dmaap-simulator`
+DMAAP_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org`
POLICY_DISTRIBUTION_IP=`get-instance-ip.sh policy-distribution`
echo PAP IP IS ${POLICY_PAP_IP}
@@ -94,4 +57,10 @@ echo APEX IP IS ${APEX_IP}
echo DMAAP_IP IS ${DMAAP_IP}
echo POLICY_DISTRIBUTION_IP IS ${POLICY_DISTRIBUTION_IP}
-ROBOT_VARIABLES="-v APEX_IP:${APEX_IP} -v SCRIPT_DIR:${SCRIPT_DIR} -v POLICY_DISTRIBUTION_IP:${POLICY_DISTRIBUTION_IP}"
+# wait for the app to start up
+${SCRIPTS}/policy/wait_for_port.sh ${POLICY_DISTRIBUTION_IP} 6969
+
+ROBOT_VARIABLES=""
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCRIPT_DIR:${SCRIPT_DIR}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DISTRIBUTION_IP:${POLICY_DISTRIBUTION_IP}"
diff --git a/plans/policy/distribution/teardown.sh b/plans/policy/distribution/teardown.sh
index fbbf1de5..86416e6e 100644
--- a/plans/policy/distribution/teardown.sh
+++ b/plans/policy/distribution/teardown.sh
@@ -3,6 +3,7 @@
# Copyright (C) 2018 Ericsson. All rights reserved.
#
# Modifications copyright (c) 2019 Nordix Foundation.
+# Modifications Copyright (C) 2020 AT&T Intellectual Property.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,9 +20,4 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-kill-instance.sh policy-apex-pdp
-kill-instance.sh policy-pap
-kill-instance.sh policy-api
-kill-instance.sh mariadb
-kill-instance.sh dmaap-simulator
-kill-instance.sh policy-distribution
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v
diff --git a/plans/policy/drools-applications/setup.sh b/plans/policy/drools-applications/setup.sh
index 1a1dc331..c4cbfa60 100755
--- a/plans/policy/drools-applications/setup.sh
+++ b/plans/policy/drools-applications/setup.sh
@@ -20,9 +20,6 @@
# OS upgrades
source ${SCRIPTS}/policy/config/policy-csit.conf
-export POLICY_MARIADB_VER
-echo ${GERRIT_BRANCH}
-echo ${POLICY_MARIADB_VER}
SCR2=${WORKSPACE}/scripts/policy/drools-apps
@@ -32,37 +29,15 @@ pip uninstall -y docker
pip install -U docker==2.7.0
sudo apt-get -y install libxml2-utils
-${SCRIPTS}/policy/policy-models-simulators.sh
+bash ${SCRIPTS}/policy/get-models-examples.sh
-POLICY_API_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_API_VERSION="${POLICY_API_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_PAP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_PAP_VERSION="${POLICY_PAP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_XACML_PDP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/xacml-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_XACML_PDP_VERSION="${POLICY_XACML_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_DROOLS_APPS_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()' -)"
-echo ${POLICY_DROOLS_APPS_VERSION_EXTRACT}
-export POLICY_DROOLS_APPS_VERSION="${POLICY_DROOLS_APPS_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
+source ${SCRIPTS}/policy/detmVers.sh
-echo ${POLICY_XACML_PDP_VERSION}
-echo ${POLICY_DROOLS_APPS_VERSION}
-
-echo "user information: $(id)"
-echo "docker and docker-compose versions:"
-docker -v && docker-compose -v
-
-# Adding this waiting container due to race condition between drools and mariadb
-docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_dependencies
-
-# Adding this waiting container due to race condition between pap and xacml
-docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_pap
-
-# now bring everything else up
-docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_all
+docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d drools-apps
unset http_proxy https_proxy
-DROOLS_IP=`get-instance-ip.sh drools`
+DROOLS_IP=`get-instance-ip.sh drools-apps`
API_IP=`get-instance-ip.sh policy-api`
PAP_IP=`get-instance-ip.sh policy-pap`
XACML_IP=`get-instance-ip.sh policy-xacml-pdp`
@@ -75,10 +50,13 @@ echo PAP IP IS ${PAP_IP}
echo XACML IP IS ${XACML_IP}
echo SIMULATORS IP IS ${SIM_IP}
+# wait for the app to start up
+${SCRIPTS}/policy/wait_for_port.sh ${DROOLS_IP} 6969
+
# give enough time for the controllers to come up
sleep 15
-DATA=${WORKSPACE}/simulators/models/models-examples/src/main/resources/policies
+DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
ROBOT_VARIABLES=""
ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCR2}"
diff --git a/plans/policy/drools-applications/teardown.sh b/plans/policy/drools-applications/teardown.sh
index 8b577d8e..67de4a1a 100755
--- a/plans/policy/drools-applications/teardown.sh
+++ b/plans/policy/drools-applications/teardown.sh
@@ -18,6 +18,6 @@
#
mkdir -p $WORKSPACE/archives/
-docker-compose -f ${WORKSPACE}/scripts/policy/drools-apps/docker-compose-drools-apps.yml logs > $WORKSPACE/archives/docker-compose-drools-apps.log
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml logs > $WORKSPACE/archives/docker-compose-drools-apps.log
-docker-compose -f ${WORKSPACE}/scripts/policy/drools-apps/docker-compose-drools-apps.yml down -v
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v
diff --git a/plans/policy/drools-pdp/setup.sh b/plans/policy/drools-pdp/setup.sh
index d50106ff..6b951356 100755
--- a/plans/policy/drools-pdp/setup.sh
+++ b/plans/policy/drools-pdp/setup.sh
@@ -24,26 +24,15 @@ 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
+source ${SCRIPTS}/policy/detmVers.sh
-docker container ls -a
+docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d drools
POLICY_DROOLS_IP=`get-instance-ip.sh drools`
MARIADB_IP=`get-instance-ip.sh mariadb`
@@ -51,10 +40,10 @@ MARIADB_IP=`get-instance-ip.sh mariadb`
echo DROOLS IP IS ${POLICY_DROOLS_IP}
echo MARIADB IP IS ${MARIADB_IP}
-for i in {1..10}; do
- curl -sS ${POLICY_DROOLS_IP}:9696 && break
- echo sleep $i
- sleep $i
-done
+# wait for the app to start up - looking for telemtry service on port 9696
+${SCRIPTS}/policy/wait_for_port.sh ${POLICY_DROOLS_IP} 9696
+
+# give enough time for the controllers to come up
+sleep 15
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 e08593d2..5a3f16e5 100755
--- a/plans/policy/drools-pdp/teardown.sh
+++ b/plans/policy/drools-pdp/teardown.sh
@@ -16,5 +16,5 @@
#
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
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml logs > $WORKSPACE/archives/docker-compose-drools.log
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v
diff --git a/plans/policy/pap/setup.sh b/plans/policy/pap/setup.sh
index a89a6daf..a1d153f8 100644
--- a/plans/policy/pap/setup.sh
+++ b/plans/policy/pap/setup.sh
@@ -19,40 +19,21 @@
# ============LICENSE_END=========================================================
source ${SCRIPTS}/policy/config/policy-csit.conf
-export POLICY_MARIADB_VER
-echo ${GERRIT_BRANCH}
-echo ${POLICY_MARIADB_VER}
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
pip uninstall -y docker
pip install -U docker==2.7.0
-
sudo apt-get -y install libxml2-utils
-bash ${SCRIPTS}/policy/policy-models-dmaap-sim.sh
-
-POLICY_API_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_API_VERSION="${POLICY_API_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_PAP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_PAP_VERSION="${POLICY_PAP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-
-echo ${POLICY_API_VERSION}
-echo ${POLICY_PAP_VERSION}
-
-# Adding this waiting container due to race condition between pap and mariadb
-docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-pap.yml run --rm start_dependencies
+bash ${SCRIPTS}/policy/get-models-examples.sh
-#Configure the database
-docker exec --tty mariadb chmod +x /docker-entrypoint-initdb.d/db.sh
-docker exec --tty mariadb /docker-entrypoint-initdb.d/db.sh
+source ${SCRIPTS}/policy/detmVers.sh
-# now bring everything else up
-docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-pap.yml run --rm start_all
+docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d pap
unset http_proxy https_proxy
-
POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
POLICY_API_IP=`get-instance-ip.sh policy-api`
MARIADB_IP=`get-instance-ip.sh mariadb`
@@ -61,7 +42,12 @@ echo PAP IP IS ${POLICY_PAP_IP}
echo API IP IS ${POLICY_API_IP}
echo MARIADB IP IS ${MARIADB_IP}
-DATA=${WORKSPACE}/dmaap-sim/models/models-examples/src/main/resources/policies
+
+# wait for the app to start up
+${SCRIPTS}/policy/wait_for_port.sh ${POLICY_PAP_IP} 6969
+
+
+DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
ROBOT_VARIABLES=""
ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}"
diff --git a/plans/policy/pap/teardown.sh b/plans/policy/pap/teardown.sh
index c2d7e214..cfed2097 100644
--- a/plans/policy/pap/teardown.sh
+++ b/plans/policy/pap/teardown.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# ============LICENSE_START=======================================================
# Copyright (C) 2019 Nordix Foundation.
-# Modifications Copyright (C) 2019 AT&T Intellectual Property.
+# Modifications Copyright (C) 2019-2020 AT&T Intellectual Property.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,6 +18,4 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-kill-instance.sh policy-pap
-kill-instance.sh policy-api
-kill-instance.sh mariadb
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v
diff --git a/plans/policy/xacml-pdp/setup.sh b/plans/policy/xacml-pdp/setup.sh
index d6726c7a..7f557d13 100644
--- a/plans/policy/xacml-pdp/setup.sh
+++ b/plans/policy/xacml-pdp/setup.sh
@@ -18,60 +18,28 @@
# ============LICENSE_END=========================================================
source ${SCRIPTS}/policy/config/policy-csit.conf
-export POLICY_MARIADB_VER
-echo ${GERRIT_BRANCH}
-echo ${POLICY_MARIADB_VER}
echo "Uninstall docker-py and reinstall docker."
pip uninstall -y docker-py
pip uninstall -y docker
pip install -U docker==2.7.0
-# 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
-
SCR_DMAAP=${SCRIPTS}/policy/drools-apps
sudo apt-get -y install libxml2-utils
-bash ${SCRIPTS}/policy/policy-models-dmaap-sim.sh
-
-POLICY_API_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_API_VERSION="${POLICY_API_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_PAP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_PAP_VERSION="${POLICY_PAP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
-POLICY_XACML_PDP_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/xacml-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
-export POLICY_XACML_PDP_VERSION="${POLICY_XACML_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
+bash ${SCRIPTS}/policy/get-models-examples.sh
-echo ${POLICY_API_VERSION}
-echo ${POLICY_PAP_VERSION}
-echo ${POLICY_XACML_PDP_VERSION}
+source ${SCRIPTS}/policy/detmVers.sh
-# Adding this waiting container due to race condition between pap and mariadb
-docker-compose -f ${WORKSPACE}/scripts/policy/policy-xacml-pdp/docker-compose-pdpx.yml run --rm start_dependencies
+docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d xacml-pdp
-# now bring everything else up
-docker-compose -f ${WORKSPACE}/scripts/policy/policy-xacml-pdp/docker-compose-pdpx.yml run --rm start_all
unset http_proxy https_proxy
POLICY_API_IP=`get-instance-ip.sh policy-api`
MARIADB_IP=`get-instance-ip.sh mariadb`
POLICY_PDPX_IP=`get-instance-ip.sh policy-xacml-pdp`
-DMAAP_IP=`get-instance-ip.sh dmaap-simulator`
+DMAAP_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org`
POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
echo PDP IP IS ${POLICY_PDPX_IP}
@@ -80,7 +48,10 @@ echo PAP IP IS ${POLICY_PAP_IP}
echo MARIADB IP IS ${MARIADB_IP}
echo DMAAP_IP IS ${DMAAP_IP}
-DATA2=${WORKSPACE}/dmaap-sim/models/models-examples/src/main/resources/policies
+# wait for the app to start up
+${SCRIPTS}/policy/wait_for_port.sh ${POLICY_PDPX_IP} 6969
+
+DATA2=${WORKSPACE}/models/models-examples/src/main/resources/policies
ROBOT_VARIABLES=""
ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR_DMAAP:${SCR_DMAAP}"
diff --git a/plans/policy/xacml-pdp/teardown.sh b/plans/policy/xacml-pdp/teardown.sh
index 270d6cc6..6942e353 100644
--- a/plans/policy/xacml-pdp/teardown.sh
+++ b/plans/policy/xacml-pdp/teardown.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.
@@ -17,8 +17,4 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-kill-instance.sh policy-xacml-pdp
-kill-instance.sh policy-pap
-kill-instance.sh policy-api
-kill-instance.sh mariadb
-kill-instance.sh dmaap-simulator
+docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v
diff --git a/plans/vnfsdk-marketplace/sanity-check/setup.sh b/plans/vnfsdk-marketplace/sanity-check/setup.sh
deleted file mode 100644
index 85c6bc27..00000000
--- a/plans/vnfsdk-marketplace/sanity-check/setup.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2016-2017 Huawei Technologies Co., Ltd.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# These scripts are sourced by run-csit.sh.
-
-
-
-#Start market place
-docker run -d -i -t --name=vnfmarket -p 8702:8702 onap/vnfmarket
-
-REPO_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' vnfmarket`
-
-
-# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v REPO_IP:${REPO_IP}"
-
-
diff --git a/plans/vnfsdk-marketplace/testsuites/docker-compose.yml b/plans/vnfsdk-marketplace/testsuites/docker-compose.yml
new file mode 100644
index 00000000..f1bb90c5
--- /dev/null
+++ b/plans/vnfsdk-marketplace/testsuites/docker-compose.yml
@@ -0,0 +1,43 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+# Copyright 2020 Nokia.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version: '2'
+networks:
+ default:
+ driver: bridge
+ driver_opts:
+ com.docker.network.driver.mtu: ${NETWORK_DRIVER_MTU}
+
+services:
+ postgres:
+ container_name: "postgres"
+ restart: "always"
+ image: "nexus3.onap.org:10001/onap/vnfsdk/refrepo/postgres:${POSTGRES_IMAGE_TAG}"
+ mem_limit: "1g"
+ memswap_limit: "1g"
+ ports:
+ - "5432:5432"
+
+ refrepo:
+ container_name: "refrepo"
+ restart: "always"
+ image: "nexus3.onap.org:10001/onap/vnfsdk/refrepo:${REFREPO_IMAGE_TAG}"
+ ports:
+ - "8702-8703:8702-8703"
+ - "50051:50051"
+ environment:
+ POSTGRES_SERVICE_HOST: postgres
+ links:
+ - postgres
diff --git a/plans/vnfsdk-marketplace/sanity-check/enterprise2DC.csar b/plans/vnfsdk-marketplace/testsuites/enterprise2DC.csar
index 0960b20a..0960b20a 100644
--- a/plans/vnfsdk-marketplace/sanity-check/enterprise2DC.csar
+++ b/plans/vnfsdk-marketplace/testsuites/enterprise2DC.csar
Binary files differ
diff --git a/plans/vnfsdk-refrepo/sanity-check/setup.sh b/plans/vnfsdk-marketplace/testsuites/setup.sh
index ed39d678..7623f71f 100644
--- a/plans/vnfsdk-refrepo/sanity-check/setup.sh
+++ b/plans/vnfsdk-marketplace/testsuites/setup.sh
@@ -1,6 +1,7 @@
#!/bin/bash
#
# Copyright 2016-2017 Huawei Technologies Co., Ltd.
+# Copyright 2020 Nokia.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,25 +16,28 @@
# limitations under the License.
#
# These scripts are sourced by run-csit.sh.
-VNFSDK_REFREPO_DOCKER_VERSION=1.3-STAGING-latest
-#Start postgres database
-docker run -d -i -t --name=postgres -p 5432:5432 nexus3.onap.org:10001/onap/vnfsdk/refrepo/postgres:latest
+REFREPO_IMAGE_TAG=latest \
+POSTGRES_IMAGE_TAG=latest \
+NETWORK_DRIVER_MTU=1450 \
+docker-compose up -d
-POSTGRES=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' postgres`
-
-#Start market place
-docker run -d -i -t --name=refrepo -e POSTGRES_SERVICE_HOST=$POSTGRES -p 8702:8702 nexus3.onap.org:10001/onap/vnfsdk/refrepo:$VNFSDK_REFREPO_DOCKER_VERSION
+DOCKER_IP=`get-docker-network-ip.sh`
# Wait for Market place initialization
echo Wait for VNF Repository initialization
-for i in {1..30}; do
- sleep 1
+# Active waiting with healthcheck and max retry count
+MAX_RETRY=30
+TRY=1
+while (( $(curl -s -o /dev/null -w ''%{http_code}'' ${DOCKER_IP}:8702/onapapi/vnfsdk-marketplace/v1/PackageResource/healthcheck) != 200 )) && (($TRY < $MAX_RETRY)); do
+ sleep 4
+ TRY=$[$TRY+1]
done
-REPO_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' refrepo`
-
+# Get refrepo logs for easier debug in case of failure
+docker logs refrepo
+REFREPO_IP=`get-instance-ip.sh refrepo`
# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS} -v REPO_IP:${REPO_IP}"
+ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS} -v REPO_IP:${REFREPO_IP}"
echo ${ROBOT_VARIABLES}
diff --git a/plans/vnfsdk-marketplace/sanity-check/teardown.sh b/plans/vnfsdk-marketplace/testsuites/teardown.sh
index 42d7b7fd..1bf79225 100644
--- a/plans/vnfsdk-marketplace/sanity-check/teardown.sh
+++ b/plans/vnfsdk-marketplace/testsuites/teardown.sh
@@ -1,6 +1,7 @@
#!/bin/bash
#
# Copyright 2016-2017 Huawei Technologies Co., Ltd.
+# Copyright 2020 Nokia.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,6 +17,4 @@
#
# This script is sourced by run-csit.sh after Robot test completion.
-
-kill-instance.sh vnfmarket
-
+docker-compose down
diff --git a/plans/vnfsdk-marketplace/sanity-check/testplan.txt b/plans/vnfsdk-marketplace/testsuites/testplan.txt
index b5370f38..b5370f38 100644
--- a/plans/vnfsdk-marketplace/sanity-check/testplan.txt
+++ b/plans/vnfsdk-marketplace/testsuites/testplan.txt
diff --git a/plans/vnfsdk-marketplace/sanity-check/uploadCSAR.sh b/plans/vnfsdk-marketplace/testsuites/uploadCSAR.sh
index 279912c3..279912c3 100644
--- a/plans/vnfsdk-marketplace/sanity-check/uploadCSAR.sh
+++ b/plans/vnfsdk-marketplace/testsuites/uploadCSAR.sh
diff --git a/plans/vnfsdk-refrepo/sanity-check/enterprise2DC.csar b/plans/vnfsdk-refrepo/sanity-check/enterprise2DC.csar
deleted file mode 100644
index 0960b20a..00000000
--- a/plans/vnfsdk-refrepo/sanity-check/enterprise2DC.csar
+++ /dev/null
Binary files differ
diff --git a/plans/vnfsdk-refrepo/sanity-check/uploadCSAR.sh b/plans/vnfsdk-refrepo/sanity-check/uploadCSAR.sh
deleted file mode 100644
index 279912c3..00000000
--- a/plans/vnfsdk-refrepo/sanity-check/uploadCSAR.sh
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/usr/bin/env bash
-###############################################################################
-# Copyright 2017 Huawei Technologies Co., Ltd.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-###############################################################################
-SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-echo $SCRIPT_DIR
-
-#CHECK IF MSB_ADDR IS GIVEN IN COMMAND
-if [ -z "$1" ]
-then
- echo "There is no MSB_ADDR"
- exit 1
-fi
-MSB_ADDR=$1
-CSAR_NAME=$2
-echo $MSB_ADDR
-echo $CSAR_NAME
-
-# Wait for MSB initialization
-echo Wait for MSB initialization
-for i in {1..20}; do
- curl -sS -m 1 $MSB_ADDR > /dev/null && break
- sleep $i
-done
-#MSB initialized
-###########################################
-###########################################
-###########################################
-###########################################
-###########################################
-###########################################
-############UOLOAD PACKAGE to MARKET PLACE######################
-echo
-echo "############## UOLOAD PACKAGE to MARKET PLACE STARTED ##############";
-UploadPackageResponse=$(curl -sS -X POST -H "Content-Type: multipart/form-data;" -F "file=@$CSAR_NAME" http://$MSB_ADDR/openoapi/vnfsdk-marketplace/v1/PackageResource/csars)
-if echo "$UploadPackageResponse" | grep -q "\"csarId\""; then
- echo "UOLOAD PACKAGE TO MARKET PLACE SUCSSS !!!";
-else
- echo "UploadPackageResponse :$UploadPackageResponse"
- echo "UOLOAD PACKAGE TO MARKET PLACE FAILED !!!";
- exit 1;
-fi
-UploadCsarId=$(echo ${UploadPackageResponse:11:36})
-echo "PACKAGE ID:$UploadCsarId"
-echo "############## UOLOAD PACKAGE to MARKET PLACE END ##################";
-#######UOLOAD PACKAGE to MARKET PLACE END#############
-###########################################
-###########################################
-###########################################
-###########################################
-###########################################
-###########################################
-###########################################
-################GET ON BOARD STATUS########
-echo
-echo "####################### GETTING ON-BOARDING STATUS ##################";
-#sleeping for 10 sec so thate ON Boarding operation should be happened at backend
-for pc in $(seq 1 10); do
- status=$((${pc}*10));
- echo -ne "ON_BOARDING Status (%): $status\033[0K\r"
- sleep 1
-done
-echo
-
-#Three Retries for getting On Boarding Result
-#count=0
-#while [ $count -lt 3 ]
-#do
-# OnBoardStatusResponse=$(curl -sS -X GET "http://$MSB_ADDR/openoapi/vnfsdk-marketplace/v1/PackageResource/csars/$UploadCsarId/onboardstatus?operTypeId=functiontest&operId=functestexec" -H "Accept: application/json" -H "Content-Type: application/json")
-# echo $OnBoardStatusResponse
-# if echo "$OnBoardStatusResponse" | grep -q "\"status\":0"; then
-# break;
-# else
-# if [ $count -eq 3 ]
-# then
-# echo "ON-BOARDING OPERATION FAILED !!!";
-# fi
-# count=`expr $count + 1`;
-# sleep 3;
-# fi
-#done
-echo "GET ON-BOARDING RESULT OPERATION SUCESS ";
-echo "##################### GETTING ON-BOARDING STATUS END #################";
-####################GET ON BOARD STATUS END############
-##########################################
-##########################################
-##########################################
-##########################################
-##########################################
-#################DOWNLOAD PACKAGE#########
-echo
-echo "############## DOWNLOADED PACKAGE FROM MARKET STARTED #################";
-PACKAGE_NAME=market_temp.csar
-curl -sS -X GET "http://$MSB_ADDR/openoapi/vnfsdk-marketplace/v1/PackageResource/csars/$UploadCsarId/files" > $PACKAGE_NAME
-fileSize=$(du -b $PACKAGE_NAME | cut -f 1)
-if [ $fileSize -eq 0 ]
-then
- echo "DOWNLOADED PACKAGE FROM MARKET NOT PROPER, ON-BOARDING OPERATION FAILED !!!";
- exit 1;
-fi
-echo "DOWNLOADED PACKAGE FROM MARKET OPERATION SUCESS !!!";
-echo "MARKET PACKAGE NAME:$PACKAGE_NAME"
-echo "##################### DOWNLOADED PACKAGE FROM MARKET ##################";
-###################DOWNLOAD PACKAGE END#####################
-##########################################
-##########################################
-##########################################
-##########################################
-##########CATALOUGE START#################
-echo
-PACKAGE_NAME=$CSAR_NAME
-#Check if common-tosca-catalog is registered with MSB or not
-#curl -sS -X GET http://$MSB_ADDR/api/microservices/v1/services/catalog/version/v1 -H "Accept: application/json" -H "Content-Type: application/json"
-#check if common-tosca-aria is registered with MSB or not
-#curl -sS -X GET http://$MSB_ADDR/api/microservices/v1/services/tosca/version/v1 -H "Accept: application/json" -H "Content-Type: application/json"
-#echo Sending POST request to Catalog
-CsarIdString=$(curl -sS -X POST -H "Content-Type: multipart/form-data; boundary=-WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Cache-Control: no-cache" -H "Postman-Token: abcb6497-b225-c592-01be-e9ff460ca188" -F "file=@$PACKAGE_NAME" http://$MSB_ADDR/openoapi/catalog/v1/csars)
-#getting csarId from the output of curl request
-CsarId=$(echo ${CsarIdString:11:36})
-echo $CsarId
-echo $CsarIdString
-#csarid is sucessfully stored in CsarId variable
-echo "====finished======"
-##########CATALOUGE END############
-echo "DELETING PACAKE LOCAL COPY:$PACKAGE_NAME";
-#rm $PACKAGE_NAME;
diff --git a/plans/vnfsdk-refrepo/testsuites/setup.sh b/plans/vnfsdk-refrepo/testsuites/setup.sh
new file mode 100644
index 00000000..0d41584b
--- /dev/null
+++ b/plans/vnfsdk-refrepo/testsuites/setup.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+# Copyright 2016-2017 Huawei Technologies Co., Ltd.
+# Copyright 2020 Nokia.
+#
+# 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.
+#
+# These scripts are sourced by run-csit.sh.
+
+VNFSDK_REFREPO_DOCKER_VERSION=latest
+
+#Start market place
+docker run -d -i -t --name refrepo -p 8702:8702 nexus3.onap.org:10001/onap/vnfsdk/refrepo:$VNFSDK_REFREPO_DOCKER_VERSION
+DOCKER_IP=`get-docker-network-ip.sh`
+
+# Wait for Market place initialization
+echo Wait for VNF Repository initialization
+# Active waiting with healthcheck and max retry count
+MAX_RETRY=30
+TRY=1
+while (( $(curl -s -o /dev/null -w ''%{http_code}'' ${DOCKER_IP}:8702/onapapi/vnfsdk-marketplace/v1/PackageResource/healthcheck) != 200 )) && (($TRY < $MAX_RETRY)); do
+ sleep 4
+ TRY=$[$TRY+1]
+done
+
+REFREPO_IP=`get-instance-ip.sh refrepo`
+
+# Get refrepo logs for easier debug in case of failure
+docker logs refrepo
+
+# Pass any variables required by Robot test suites in ROBOT_VARIABLES
+ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS} -v REFREPO_IP:${REFREPO_IP}"
+echo ${ROBOT_VARIABLES}
diff --git a/plans/vnfsdk-refrepo/sanity-check/teardown.sh b/plans/vnfsdk-refrepo/testsuites/teardown.sh
index 19440bc7..f7c57113 100644
--- a/plans/vnfsdk-refrepo/sanity-check/teardown.sh
+++ b/plans/vnfsdk-refrepo/testsuites/teardown.sh
@@ -1,6 +1,7 @@
#!/bin/bash
#
# Copyright 2016-2017 Huawei Technologies Co., Ltd.
+# Copyright 2020 Nokia.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,8 +17,5 @@
#
# This script is sourced by run-csit.sh after Robot test completion.
-
kill-instance.sh refrepo
-kill-instance.sh postgres
-
diff --git a/plans/vnfsdk-refrepo/sanity-check/testplan.txt b/plans/vnfsdk-refrepo/testsuites/testplan.txt
index b5370f38..bc6629d6 100644
--- a/plans/vnfsdk-refrepo/sanity-check/testplan.txt
+++ b/plans/vnfsdk-refrepo/testsuites/testplan.txt
@@ -1,3 +1,3 @@
## Test suites are relative paths under [integration/csit.git]/tests/.
## Place the suites in run order.
-vnfsdk-marketplace/provision/sanity_test_vnfsdktestfunction.robot
+vnfsdk-refrepo/csar_validation_tests.robot