3 # ===========LICENSE_START====================================================
4 # Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
5 # ============================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=====================================================
22 source ${SCRIPTS}/policy/config/policy-csit.conf
23 export POLICY_MARIADB_VER
25 echo ${POLICY_MARIADB_VER}
27 SCR2=${WORKSPACE}/scripts/policy/drools-apps
29 echo "Uninstall docker-py and reinstall docker."
30 pip uninstall -y docker-py
31 pip uninstall -y docker
32 pip install -U docker==2.7.0
34 sudo apt-get -y install libxml2-utils
35 ${SCRIPTS}/policy/policy-models-simulators.sh
37 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()' -)"
38 export POLICY_XACML_PDP_VERSION="${POLICY_XACML_PDP_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
39 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()' -)"
40 echo ${POLICY_DROOLS_APPS_VERSION_EXTRACT}
41 export POLICY_DROOLS_APPS_VERSION="${POLICY_DROOLS_APPS_VERSION_EXTRACT:0:3}-SNAPSHOT-latest"
43 echo ${POLICY_XACML_PDP_VERSION}
44 echo ${POLICY_DROOLS_APPS_VERSION}
46 echo "user information: $(id)"
47 echo "docker and docker-compose versions:"
48 docker -v && docker-compose -v
50 # Adding this waiting container due to race condition between drools and mariadb
51 docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_dependencies
53 # now bring everything else up
54 docker-compose -f ${SCR2}/docker-compose-drools-apps.yml run --rm start_all
56 unset http_proxy https_proxy
58 DROOLS_IP=`get-instance-ip.sh drools`
59 XACML_IP=`get-instance-ip.sh policy-xacml-pdp`
60 SIM_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org`
63 echo DROOLS IP IS ${DROOLS_IP}
64 echo XACML IP IS ${XACML_IP}
65 echo SIMULATORS IP IS ${SIM_IP}
68 ${SCR2}/manage.sh ${SCR2}/activate.xacml.json
70 # give enough time for the controllers to come up
73 # wait for xacml to activate
74 ${SCRIPTS}/policy/wait_for_port.sh ${XACML_IP} 6969
77 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCR2}"
78 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}"
79 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}"
80 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}"