Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # ===========LICENSE_START==================================================== |
| 4 | # Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. |
adheli.tavares | 7abe36c | 2022-02-02 14:53:10 +0000 | [diff] [blame] | 5 | # Modifications Copyright 2021-2022 Nordix Foundation. |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 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 | # ============LICENSE_END===================================================== |
| 19 | # |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 20 | |
| 21 | echo "Uninstall docker-py and reinstall docker." |
Jim Hahn | fe3e91c | 2021-06-04 13:22:49 -0400 | [diff] [blame] | 22 | python3 -m pip uninstall -y docker-py |
| 23 | python3 -m pip uninstall -y docker |
| 24 | python3 -m pip install -U docker |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 25 | |
| 26 | sudo apt-get -y install libxml2-utils |
| 27 | |
adheli.tavares | 7abe36c | 2022-02-02 14:53:10 +0000 | [diff] [blame] | 28 | source "${SCRIPTS}"/get-versions.sh |
| 29 | bash "${SCRIPTS}"/get-models-examples.sh |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 30 | |
adheli.tavares | 7abe36c | 2022-02-02 14:53:10 +0000 | [diff] [blame] | 31 | docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d drools-apps |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 32 | |
| 33 | unset http_proxy https_proxy |
| 34 | |
adheli.tavares | 7abe36c | 2022-02-02 14:53:10 +0000 | [diff] [blame] | 35 | DROOLS_IP=$(get-instance-ip.sh drools-apps) |
| 36 | API_IP=$(get-instance-ip.sh policy-api) |
| 37 | PAP_IP=$(get-instance-ip.sh policy-pap) |
| 38 | XACML_IP=$(get-instance-ip.sh policy-xacml-pdp) |
| 39 | SIM_IP=$(get-instance-ip.sh simulator) |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 40 | export SIM_IP |
| 41 | |
adheli.tavares | 7abe36c | 2022-02-02 14:53:10 +0000 | [diff] [blame] | 42 | echo DROOLS IP IS "${DROOLS_IP}" |
| 43 | echo API IP IS "${API_IP}" |
| 44 | echo PAP IP IS "${PAP_IP}" |
| 45 | echo XACML IP IS "${XACML_IP}" |
| 46 | echo SIMULATORS IP IS "${SIM_IP}" |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 47 | |
| 48 | # wait for the app to start up |
adheli.tavares | 7abe36c | 2022-02-02 14:53:10 +0000 | [diff] [blame] | 49 | "${SCRIPTS}"/wait_for_port.sh "${DROOLS_IP}" 6969 |
Jim Hahn | b3a962f | 2021-05-12 11:33:43 -0400 | [diff] [blame] | 50 | |
| 51 | # give enough time for the controllers to come up |
| 52 | sleep 15 |
| 53 | |
| 54 | DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies |
| 55 | DATA2=${TESTPLANDIR}/tests/data |
| 56 | |
| 57 | ROBOT_VARIABLES="" |
| 58 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCRIPTS}" |
| 59 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}" |
| 60 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}" |
| 61 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}" |
| 62 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}" |
| 63 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}" |
| 64 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}" |
| 65 | ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}" |