a51938c80793e01ba13759713c715813db0279db
[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:='opnfv-jump-2'}
17 : ${EXTERNAL_NETWORK:='net04_ext'}
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     $RELENG_REPO_DIR/utils/fetch_os_creds.sh \
30         -d $OPENRC \
31         -i ${INSTALLER_TYPE} -a ${INSTALLER_IP}
32 fi
33 source $OPENRC
34
35 export EXTERNAL_NETWORK INSTALLER_TYPE NODE_NAME