Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2018 Ericsson. All rights reserved. |
| 4 | # |
| 5 | # Modifications copyright (c) 2019 Nordix Foundation. |
| 6 | # Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. |
arkadiusz.adamski | 2b1e8d0 | 2021-05-24 12:50:40 +0100 | [diff] [blame] | 7 | # Modification Copyright 2021. Nordix Foundation. |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 8 | # ================================================================================ |
| 9 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | # you may not use this file except in compliance with the License. |
| 11 | # You may obtain a copy of the License at |
| 12 | # |
| 13 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | # |
| 15 | # Unless required by applicable law or agreed to in writing, software |
| 16 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | # See the License for the specific language governing permissions and |
| 19 | # limitations under the License. |
| 20 | # |
| 21 | # SPDX-License-Identifier: Apache-2.0 |
| 22 | # ============LICENSE_END========================================================= |
| 23 | source ${SCRIPTS}/get-branch-mariadb.sh |
| 24 | |
| 25 | echo "Uninstall docker-py and reinstall docker." |
arkadiusz.adamski | 2b1e8d0 | 2021-05-24 12:50:40 +0100 | [diff] [blame] | 26 | pip3 uninstall -y docker-py |
| 27 | pip3 uninstall -y docker |
| 28 | pip3 install -U docker |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 29 | |
| 30 | sudo apt-get -y install libxml2-utils |
| 31 | |
| 32 | source ${SCRIPTS}/detmVers.sh |
| 33 | |
| 34 | SCRIPT_DIR=${TESTPLANDIR}/config |
| 35 | |
| 36 | # Remaking the csar file in case if the file got corrupted |
| 37 | zip -F ${SCRIPT_DIR}/csar/sample_csar_with_apex_policy.csar --out ${SCRIPT_DIR}/csar/csar_temp.csar |
| 38 | |
| 39 | # Remake temp directory |
| 40 | rm -rf ${SCRIPT_DIR}/temp |
| 41 | mkdir ${SCRIPT_DIR}/temp |
| 42 | |
| 43 | docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d distribution |
| 44 | |
| 45 | unset http_proxy https_proxy |
| 46 | |
| 47 | POLICY_API_IP=`get-instance-ip.sh policy-api` |
| 48 | POLICY_PAP_IP=`get-instance-ip.sh policy-pap` |
| 49 | MARIADB_IP=`get-instance-ip.sh mariadb` |
| 50 | APEX_IP=`get-instance-ip.sh policy-apex-pdp` |
| 51 | DMAAP_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org` |
| 52 | POLICY_DISTRIBUTION_IP=`get-instance-ip.sh policy-distribution` |
| 53 | |
| 54 | echo PAP IP IS ${POLICY_PAP_IP} |
| 55 | echo MARIADB IP IS ${MARIADB_IP} |
| 56 | echo API IP IS ${POLICY_API_IP} |
| 57 | echo APEX IP IS ${APEX_IP} |
| 58 | echo DMAAP_IP IS ${DMAAP_IP} |
| 59 | echo POLICY_DISTRIBUTION_IP IS ${POLICY_DISTRIBUTION_IP} |
| 60 | |
| 61 | # wait for the app to start up |
| 62 | ${SCRIPTS}/wait_for_port.sh ${POLICY_DISTRIBUTION_IP} 6969 |
| 63 | |
| 64 | ROBOT_VARIABLES="" |
| 65 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}" |
| 66 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCRIPT_DIR:${SCRIPT_DIR}" |
| 67 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DISTRIBUTION_IP:${POLICY_DISTRIBUTION_IP}" |