aodh/run-tests.sh
Julien Danjou 693204a37e nova notifier: disable tests + update sample conf
The nova notifier is again broken due to Nova switch to oslo.messaging.

Anyway, it's likely that this code has been broken for a long time, as
it is not enabled nor tested on devstack anymore. And it's very unlikely
compatible with oslo.messaging.

This patch only disable the run of the tests for now, but we might
consider removing the code before i3 if nobody stands up and try to fix
it in a way or another.

This patch also update the configuration file for the new keystoneclient
release.

Change-Id: I679154baff476957f46e7930db69aeec7e368648
2014-02-05 13:00:25 +01:00

38 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
function clean_exit(){
local error_code="$?"
rm -rf ${MONGO_DATA}
kill $(jobs -p)
return $error_code
}
if [ "$1" = "--coverage" ]; then
COVERAGE_ARG="$1"
shift
fi
# Main unit tests
MONGO_DATA=`mktemp -d /tmp/CEILO-MONGODB-XXXXX`
MONGO_PORT=29000
trap "clean_exit" EXIT
mkfifo ${MONGO_DATA}/out
export PATH=${PATH:+$PATH:}/sbin:/usr/sbin
if ! which mongod >/dev/null 2>&1
then
echo "Could not find mongod command" 1>&2
exit 1
fi
mongod --maxConns 32 --nojournal --noprealloc --smallfiles --quiet --noauth --port ${MONGO_PORT} --dbpath "${MONGO_DATA}" --bind_ip localhost --config /dev/null &>${MONGO_DATA}/out &
# Wait for Mongo to start listening to connections
while read line
do
echo "$line" | grep -q "waiting for connections on port ${MONGO_PORT}" && break
done < ${MONGO_DATA}/out
# Read the fifo for ever otherwise mongod would block
# + that gives us the log on screen
cat ${MONGO_DATA}/out > /dev/null &
export CEILOMETER_TEST_MONGODB_URL="mongodb://localhost:${MONGO_PORT}/ceilometer"
python setup.py testr --slowest --testr-args="$*" $COVERAGE_ARG