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