blob: b74950075e2fa9f85831c56f0761c8a2cb41b91d [file] [log] [blame]
Jim Hahnb3a962f2021-05-12 11:33:43 -04001#!/bin/bash
2# ============LICENSE_START=======================================================
3# Copyright (C) 2018 Ericsson. All rights reserved.
adheli.tavares7abe36c2022-02-02 14:53:10 +00004# Modifications Copyright (c) 2019-2022 Nordix Foundation.
Jim Hahnb3a962f2021-05-12 11:33:43 -04005# 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 Hahnb3a962f2021-05-12 11:33:43 -040021
22echo "Uninstall docker-py and reinstall docker."
Jim Hahnfe3e91c2021-06-04 13:22:49 -040023python3 -m pip uninstall -y docker-py
24python3 -m pip uninstall -y docker
25python3 -m pip install -U docker
Jim Hahnb3a962f2021-05-12 11:33:43 -040026
27sudo apt-get -y install libxml2-utils
28
adheli.tavares7abe36c2022-02-02 14:53:10 +000029source "${SCRIPTS}"/get-versions.sh
Jim Hahnb3a962f2021-05-12 11:33:43 -040030
31SCRIPT_DIR=${TESTPLANDIR}/config
32
33# Remaking the csar file in case if the file got corrupted
adheli.tavares7abe36c2022-02-02 14:53:10 +000034zip -F "${SCRIPT_DIR}"/csar/sample_csar_with_apex_policy.csar --out "${SCRIPT_DIR}"/csar/csar_temp.csar
Jim Hahnb3a962f2021-05-12 11:33:43 -040035
36# Remake temp directory
adheli.tavares7abe36c2022-02-02 14:53:10 +000037rm -rf "${SCRIPT_DIR}"/temp
38mkdir "${SCRIPT_DIR}"/temp
Jim Hahnb3a962f2021-05-12 11:33:43 -040039
adheli.tavares7abe36c2022-02-02 14:53:10 +000040docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d distribution
Jim Hahnb3a962f2021-05-12 11:33:43 -040041
42unset http_proxy https_proxy
43
adheli.tavares7abe36c2022-02-02 14:53:10 +000044POLICY_API_IP=$(get-instance-ip.sh policy-api)
45POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
46MARIADB_IP=$(get-instance-ip.sh mariadb)
47APEX_IP=$(get-instance-ip.sh policy-apex-pdp)
48DMAAP_IP=$(get-instance-ip.sh simulator)
49POLICY_DISTRIBUTION_IP=$(get-instance-ip.sh policy-distribution)
Jim Hahnb3a962f2021-05-12 11:33:43 -040050
adheli.tavares7abe36c2022-02-02 14:53:10 +000051echo PAP IP IS "${POLICY_PAP_IP}"
52echo MARIADB IP IS "${MARIADB_IP}"
53echo API IP IS "${POLICY_API_IP}"
54echo APEX IP IS "${APEX_IP}"
55echo DMAAP_IP IS "${DMAAP_IP}"
56echo POLICY_DISTRIBUTION_IP IS "${POLICY_DISTRIBUTION_IP}"
Jim Hahnb3a962f2021-05-12 11:33:43 -040057
58# wait for the app to start up
adheli.tavares7abe36c2022-02-02 14:53:10 +000059"${SCRIPTS}"/wait_for_port.sh "${POLICY_DISTRIBUTION_IP}" 6969
Jim Hahnb3a962f2021-05-12 11:33:43 -040060
61ROBOT_VARIABLES=""
62ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}"
63ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCRIPT_DIR:${SCRIPT_DIR}"
64ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DISTRIBUTION_IP:${POLICY_DISTRIBUTION_IP}"