add memory_load scenario
[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 : ${DEPLOY_TYPE:='bm'} # Can be any of 'bm' (Bare Metal) or 'virt' (Virtual)
16
17 : ${NODE_NAME:='unknown'}
18 : ${EXTERNAL_NETWORK:='admin_floating_net'}
19
20
21 # Extract network name from EXTERNAL_NETWORK
22 #  e.g. EXTERNAL_NETWORK='ext-net;flat;192.168.0.2;192.168.0.253;192.168.0.1;192.168.0.0/24'
23 export EXTERNAL_NETWORK=$(echo $EXTERNAL_NETWORK | cut -f1 -d \;)
24
25 echo
26 echo "INFO: Creating openstack credentials .."
27
28 # Create openstack credentials
29 OPENRC=/home/opnfv/openrc
30 if [ ! -f $OPENRC ]; then
31     if [ "$DEPLOY_TYPE" == "virt" ]; then
32         FETCH_CRED_ARG="-v -d $OPENRC -i ${INSTALLER_TYPE} -a ${INSTALLER_IP}"
33     else
34         FETCH_CRED_ARG="-d $OPENRC -i ${INSTALLER_TYPE} -a ${INSTALLER_IP}"
35     fi
36
37     $RELENG_REPO_DIR/utils/fetch_os_creds.sh $FETCH_CRED_ARG
38
39 fi
40
41 source $OPENRC
42
43 export EXTERNAL_NETWORK INSTALLER_TYPE DEPLOY_TYPE NODE_NAME