3 # Copyright 2016-2017 Huawei Technologies Co., Ltd.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 echo "### This is ${WORKSPACE}/scripts/optf-has/has/simulator_script.sh"
19 # add here whatever commands is needed to prepare the optf/has CSIT testing
22 # assume the base is /tmp dir
25 # the directory of the script
29 # the temp directory used, within $DIR
30 # omit the -p parameter to create a temporal directory in the default location
31 WORK_DIR=`mktemp -d -p "$DIR"`
35 # clone optf-has project
36 git clone https://gerrit.onap.org/r/optf/has
38 #echo "i am ${USER} : only non jenkins users may need proxy settings"
39 if [ ${USER} != 'jenkins' ]; then
41 # add proxy settings into this script when you work behind a proxy
42 ${WORKSPACE}/scripts/optf-has/has/has_proxy_settings.sh ${WORK_DIR}
47 cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/aaisim/
49 # check Dockerfile content
53 docker build -t aaisim .
56 docker run -d --name aaisim -p 8081:8081 aaisim
58 AAISIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aaisim`
59 echo "AAISIM_IP=${AAISIM_IP}"
61 ${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${AAISIM_IP} 8081
63 # prepare multicloudsim
64 cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/multicloudsim/
66 # check Dockerfile content
70 docker build -t multicloudsim .
73 docker run -d --name multicloudsim -p 8082:8082 multicloudsim
75 MULTICLOUDSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' multicloudsim`
76 echo "MULTICLOUDSIM_IP=${MULTICLOUDSIM_IP}"
78 ${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${MULTICLOUDSIM_IP} 8082
81 echo "simulator_script: prepare aafsim "
82 cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/aafsim/
84 # check Dockerfile content
85 echo "simulator_script: Dockerfile "
89 echo "simulator_script: build docker "
90 docker build -t aafsim .
93 echo "simulator_script: run docker "
94 docker run -d --name aafsim -p 8100:8100 aafsim
96 AAFSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aafsim`
97 echo "simulator_script: AAFSIM_IP=${AAFSIM_IP}"
99 #echo "simulator_script: wait_for_port"
100 ${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${AAFSIM_IP} 8100
102 # wait a while before continuing
105 echo "inspect docker things for tracing purpose"
106 docker inspect aaisim
107 docker inspect multicloudsim
108 docker inspect aafsim