blob: 87ba6d5010cc11868b3392ada786009dc7d264a0 [file] [log] [blame]
Attila Fazekas5abb2532012-12-04 11:30:49 +01001#!/usr/bin/env bash
2
3function usage {
4 echo "Usage: $0 [OPTION]..."
5 echo "Run Tempest test suite"
6 echo ""
7 echo " -s, --smoke Only run smoke tests"
8 echo " -w, --whitebox Only run whitebox tests"
9 echo " -h, --help Print this usage message"
10 echo " -d. --debug Debug this script -- set -o xtrace"
11 exit
12}
13
14function process_option {
15 case "$1" in
16 -h|--help) usage;;
17 -d|--debug) set -o xtrace;;
18 -s|--smoke) noseargs="$noseargs --attr=type=smoke";;
19 -w|--whitebox) noseargs="$noseargs --attr=type=whitebox";;
20 *) noseargs="$noseargs $1"
21 esac
22}
23
24noseargs=""
25
26export NOSE_WITH_OPENSTACK=1
27export NOSE_OPENSTACK_COLOR=1
28export NOSE_OPENSTACK_RED=15.00
29export NOSE_OPENSTACK_YELLOW=3.00
30export NOSE_OPENSTACK_SHOW_ELAPSED=1
31export NOSE_OPENSTACK_STDOUT=1
32
33for arg in "$@"; do
34 process_option $arg
35done
36
37
38# only add tempest default if we don't specify a test
39if [[ "x$noseargs" =~ "tempest" ]]; then
40 noseargs="$noseargs"
41else
42 noseargs="$noseargs tempest"
43fi
44
45
46function run_tests {
47 $NOSETESTS
48}
49
50NOSETESTS="nosetests $noseargs"
51
52run_tests || exit