diff options
author | 2015-10-21 18:22:46 +0200 | |
---|---|---|
committer | 2015-10-22 14:17:29 +0200 | |
commit | 98a2966601137e094af49059a2d419c1143b1f82 (patch) | |
tree | a779b090b86cb75c494b8b9677c24b50bc4cfe50 /docker/prepare_env.sh | |
parent | b3e241e1ee0e794ec732eddc5eaeb1f59dc1a999 (diff) |
Add possibility to run specific set of tests
JIRA: FUNCTEST-29
Change-Id: I20f1556911866cc7922cff9923ef7d01a95355ad
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'docker/prepare_env.sh')
-rwxr-xr-x | docker/prepare_env.sh | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/docker/prepare_env.sh b/docker/prepare_env.sh index eaa9b4f00..42b1e1c43 100755 --- a/docker/prepare_env.sh +++ b/docker/prepare_env.sh @@ -7,15 +7,47 @@ # and run the tests automatically # +usage="Script to prepare the Functest environment. + +usage: + bash $(basename "$0") [--offline] [-h|--help] [-t <test_name>] + +where: + -o|--offline optional offline mode (experimental) + -h|--help show this help text + +examples: + $(basename "$0") + $(basename "$0") --offline" + +offline=false + +# Parse parameters +while [[ $# > 0 ]] + do + key="$1" + case $key in + -h|--help) + echo "$usage" + exit 0 + shift + ;; + -o|--offline) + offline=true + ;; + *) + error "unknown option $1" + exit 1 + ;; + esac + shift # past argument or value +done + BASEDIR=`dirname $0` source ${BASEDIR}/common.sh # Support for Functest offline # NOTE: Still not 100% working when running the tests -offline=false -if [ ! -z "$1" ] && [ $1 == "--offline" ]; then - offline=true -fi info "######### Preparing Functest environment #########" if [ $offline == false ]; then @@ -86,8 +118,6 @@ mkdir -p ${FUNCTEST_CONF_DIR} mkdir -p ${FUNCTEST_DATA_DIR} mkdir -p ${FUNCTEST_RESULTS_DIR}/ODL -# Detect type of installer -# NOTE: this is tricky, since the IPs will have to be the same ALWAYS # Create Openstack credentials file @@ -95,7 +125,7 @@ ${REPOS_DIR}/releng/utils/fetch_os_creds.sh -d ${FUNCTEST_CONF_DIR}/openstack.cr -i ${INSTALLER_TYPE} -a ${INSTALLER_IP} retval=$? if [ $retval != 0 ]; then - echo "Cannot retrieve credentials file from installation. Check logs." + error "Cannot retrieve credentials file from installation. Check logs." exit $retval fi @@ -105,11 +135,11 @@ source ${FUNCTEST_CONF_DIR}/openstack.creds # Prepare Functest Environment -echo "Functest: prepare Functest environment" +info "Functest: prepare Functest environment" python ${FUNCTEST_REPO_DIR}/testcases/config_functest.py --debug ${FUNCTEST_REPO_DIR}/ start retval=$? if [ $retval != 0 ]; then - echo "Error when configuring Functest environment" + error "Error when configuring Functest environment" exit $retval fi |