mistral/run_functional_tests.sh
Anastasia Kuznetsova aacdb47af3 Add script to run functional tests locally
- Added script that can run part of functional tests locally
- Added needed mocks in base.py file so that we don't interact with keystone
- Added small a description how to run new script

Change-Id: I1867fb93f540c8f061fd09c40a283ce1ef2c072c
2014-09-25 22:53:43 +00:00

48 lines
1.0 KiB
Bash
Executable File

#! /usr/bin/env bash
ARG=$1
function pre_hook() {
export WITHOUT_AUTH="True"
IS_TEMPEST=$(pip freeze | grep tempest)
if [ -z "$IS_TEMPEST" ]
then echo "$(tput setaf 4)No such module 'tempest' in the system. Before running this script please install 'tempest' module using : pip install git+http://github.com/openstack/tempest.git$(tput sgr 0)"
exit 1
fi
}
function run_tests_by_version() {
echo "$(tput setaf 4)Running integration API and workflow execution tests for v$1$(tput sgr 0)"
export VERSION="v$1"
nosetests -v mistral/tests/functional/api/v$1/
unset VERSION
}
function run_tests() {
if [ -z "$ARG" ]
then
run_tests_by_version 1
run_tests_by_version 2
elif [ "$ARG" == "v1" ]
then
run_tests_by_version 1
elif [ "$ARG" == "v2" ]
then
run_tests_by_version 2
fi
}
function post_hook () {
unset LOCAL_RUN
}
#----------main-part----------
echo "$(tput setaf 4)Preparation for tests running...$(tput sgr 0)"
pre_hook
echo "$(tput setaf 4)Running tests...$(tput sgr 0)"
run_tests
post_hook