Merge "Change PTL informatin in INFO"
[bottlenecks.git] / testsuites / rubbos / rubbos_scripts / 1-1-1 / scripts / env_preparation.sh
1 #!/bin/bash
2 ###############################################################################
3 # Copyright (c) 2015 Huawei Tech.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 set -ex
12
13 RELENG_REPO=https://gerrit.opnfv.org/gerrit/releng
14 RELENG_REPO_DIR=/tmp/opnfvrepo/releng
15 #RELENG_BRANCH=master # branch, tag, sha1 or refspec
16
17 INSTALLER_TYPE=fuel
18 INSTALLER_IP=10.20.0.2
19
20 NODE_NAME=opnfv-jump-2
21 EXTERNAL_NET=net04_ext
22
23 echo "INFO: Creating openstack credentials .."
24
25 if [ -d $RELENG_REPO_DIR ]; then
26     rm -rf ${RELENG_REPO_DIR}
27 fi
28 mkdir -p ${RELENG_REPO_DIR}
29 git config --global http.sslVerify false
30 git clone ${RELENG_REPO} ${RELENG_REPO_DIR}
31
32 # Create openstack credentials
33 $RELENG_REPO_DIR/utils/fetch_os_creds.sh \
34     -d /tmp/openrc \
35     -i ${INSTALLER_TYPE} -a ${INSTALLER_IP}
36
37 source /tmp/openrc
38
39 # FIXME: Temporary OPNFV playground hack
40 if [ "$INSTALLER_TYPE" == "fuel" ]; then
41     ssh_opts="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
42     if sshpass -p r00tme ssh 2>/dev/null $ssh_opts root@${INSTALLER_IP} \
43         fuel environment --env 1 | grep opnfv-virt; then
44         echo "INFO: applying OPNFV playground hack"
45         export OS_ENDPOINT_TYPE='publicURL'
46     fi
47 fi
48
49 export EXTERNAL_NET INSTALLER_TYPE NODE_NAME
50 set +ex