diff options
Diffstat (limited to 'plans')
26 files changed, 182 insertions, 428 deletions
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 Binary files differindex 0960b20a..0960b20a 100644 --- a/plans/vnfsdk-marketplace/sanity-check/enterprise2DC.csar +++ b/plans/vnfsdk-marketplace/testsuites/enterprise2DC.csar 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 Binary files differdeleted file mode 100644 index 0960b20a..00000000 --- a/plans/vnfsdk-refrepo/sanity-check/enterprise2DC.csar +++ /dev/null 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 |