blob: e72355c9c46ea90baf315ccd203b901a0d03e154 [file] [log] [blame]
Dean Troyer608bb122012-01-10 14:43:17 -06001#!/usr/bin/env bash
2#
Dean Troyere62ba4d2012-06-27 22:07:34 -05003# **build_tempest.sh**
4
5# Checkout and prepare a Tempest repo: https://github.com/openstack/tempest.git
Dean Troyer608bb122012-01-10 14:43:17 -06006
7function usage {
8 echo "$0 - Check out and prepare a Tempest repo"
9 echo ""
10 echo "Usage: $0"
11 exit 1
12}
13
14if [ "$1" = "-h" ]; then
15 usage
16fi
17
18# Clean up any resources that may be in use
19cleanup() {
20 set +o errexit
21
22 # Kill ourselves to signal any calling process
23 trap 2; kill -2 $$
24}
25
26trap cleanup SIGHUP SIGINT SIGTERM SIGQUIT EXIT
27
28# Keep track of the current directory
29TOOLS_DIR=$(cd $(dirname "$0") && pwd)
Dean Troyer7f9aa712012-01-31 12:11:56 -060030TOP_DIR=$(cd $TOOLS_DIR/..; pwd)
31
32# Import common functions
33. $TOP_DIR/functions
Dean Troyer608bb122012-01-10 14:43:17 -060034
35# Abort if localrc is not set
36if [ ! -e $TOP_DIR/localrc ]; then
37 echo "You must have a localrc with ALL necessary passwords and configuration defined before proceeding."
38 echo "See stack.sh for required passwords."
39 exit 1
40fi
41
42# Source params
43source ./stackrc
44
45# Where Openstack code lives
46DEST=${DEST:-/opt/stack}
47
48TEMPEST_DIR=$DEST/tempest
49
Dean Troyer608bb122012-01-10 14:43:17 -060050# Install tests and prerequisites
Dean Troyer7f9aa712012-01-31 12:11:56 -060051pip_install `cat $TOP_DIR/files/pips/tempest`
Dean Troyer608bb122012-01-10 14:43:17 -060052
53git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
54
55trap - SIGHUP SIGINT SIGTERM SIGQUIT EXIT