From 98a2966601137e094af49059a2d419c1143b1f82 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Wed, 21 Oct 2015 18:22:46 +0200 Subject: Add possibility to run specific set of tests JIRA: FUNCTEST-29 Change-Id: I20f1556911866cc7922cff9923ef7d01a95355ad Signed-off-by: jose.lausuch --- docker/prepare_env.sh | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) (limited to 'docker/prepare_env.sh') 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 ] + +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 -- cgit 1.2.3-korg