Release results overview
[yardstick.git] / ci / prepare_env.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
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 # Perepare the environment to run yardstick ci
12
13 : ${INSTALLER_TYPE:='fuel'}
14 : ${INSTALLER_IP:='10.20.0.2'}
15
16 : ${NODE_NAME:='unknown'}
17 : ${EXTERNAL_NETWORK:='admin_floating_net'}
18
19 # Extract network name from EXTERNAL_NETWORK
20 #  e.g. EXTERNAL_NETWORK='ext-net;flat;192.168.0.2;192.168.0.253;192.168.0.1;192.168.0.0/24'
21 export EXTERNAL_NETWORK=$(echo $EXTERNAL_NETWORK | cut -f1 -d \;)
22
23 echo
24 echo "INFO: Creating openstack credentials .."
25
26 # Create openstack credentials
27 OPENRC=/home/opnfv/openrc
28 if [ ! -f $OPENRC ]; then
29
30     $RELENG_REPO_DIR/utils/fetch_os_creds.sh \
31         -d $OPENRC \
32         -i ${INSTALLER_TYPE} -a ${INSTALLER_IP}
33
34     # Fuel virtual need a fix
35     if [ "$NODE_NAME" == "ericsson-virtual1" ]; then
36         echo "INFO: Changing: internalURL -> publicURL in openrc"
37         sed -i 's/internalURL/publicURL/' $OPENRC
38     fi
39
40 fi
41
42 source $OPENRC
43
44 export EXTERNAL_NETWORK INSTALLER_TYPE NODE_NAME