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