diff --git a/run_tempest.sh b/run_tempest.sh index a704684821..8c8f25f5ef 100755 --- a/run_tempest.sh +++ b/run_tempest.sh @@ -14,8 +14,6 @@ function usage { echo " -C, --config Config file location" echo " -h, --help Print this usage message" echo " -d, --debug Run tests with testtools instead of testr. This allows you to use PDB" - echo " -l, --logging Enable logging" - echo " -L, --logging-config Logging config file location. Default is etc/logging.conf" echo " -- [TESTROPTIONS] After the first '--' you can pass arbitrary arguments to testr " } @@ -31,10 +29,8 @@ force=0 wrapper="" config_file="" update=0 -logging=0 -logging_config=etc/logging.conf -if ! options=$(getopt -o VNnfusthdC:lL: -l virtual-env,no-virtual-env,no-site-packages,force,update,smoke,serial,help,debug,config:,logging,logging-config: -- "$@") +if ! options=$(getopt -o VNnfusthdC:lL: -l virtual-env,no-virtual-env,no-site-packages,force,update,smoke,serial,help,debug,config: -- "$@") then # parse error usage @@ -55,8 +51,6 @@ while [ $# -gt 0 ]; do -C|--config) config_file=$2; shift;; -s|--smoke) testrargs+="smoke";; -t|--serial) serial=1;; - -l|--logging) logging=1;; - -L|--logging-config) logging_config=$2; shift;; --) [ "yes" == "$first_uu" ] || testrargs="$testrargs $1"; first_uu=no ;; *) testrargs="$testrargs $1";; esac @@ -69,16 +63,6 @@ if [ -n "$config_file" ]; then export TEMPEST_CONFIG=`basename "$config_file"` fi -if [ $logging -eq 1 ]; then - if [ ! -f "$logging_config" ]; then - echo "No such logging config file: $logging_config" - exit 1 - fi - logging_config=`readlink -f "$logging_config"` - export TEMPEST_LOG_CONFIG_DIR=`dirname "$logging_config"` - export TEMPEST_LOG_CONFIG=`basename "$logging_config"` -fi - cd `dirname "$0"` if [ $no_site_packages -eq 1 ]; then diff --git a/tempest/config.py b/tempest/config.py index a6212fb123..b86e82e605 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -1436,6 +1436,13 @@ class TempestConfigPrivate(object): _CONF([], project='tempest', default_config_files=config_files) else: _CONF([], project='tempest') + + logging_cfg_path = "%s/logging.conf" % os.path.dirname(path) + if (not hasattr(_CONF, 'log_config_append') and + os.path.isfile(logging_cfg_path)): + # if logging conf is in place we need to set log_config_append + _CONF.log_config_append = logging_cfg_path + logging.setup(_CONF, 'tempest') LOG = logging.getLogger('tempest') LOG.info("Using tempest config file %s" % path)