2013-06-17 17:32:13 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2014-08-29 13:33:30 +02:00
|
|
|
source functions.sh
|
2013-07-15 19:01:49 +02:00
|
|
|
|
2014-08-29 13:33:30 +02:00
|
|
|
if [ "$1" = "--coverage" ]; then
|
|
|
|
COVERAGE_ARG="$1"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
|
|
|
export PATH=${PATH:+$PATH:}/sbin:/usr/sbin
|
|
|
|
check_for_cmd mongod
|
|
|
|
|
|
|
|
# Start MongoDB process for tests
|
2015-02-19 17:02:20 +00:00
|
|
|
MONGO_DATA=`mktemp -d /tmp/CEILO-MONGODB-XXXXX`
|
2013-09-09 11:04:34 +02:00
|
|
|
MONGO_PORT=29000
|
2014-08-29 13:33:30 +02:00
|
|
|
trap "clean_exit ${MONGO_DATA}" EXIT
|
2013-07-15 19:54:31 +02:00
|
|
|
mkfifo ${MONGO_DATA}/out
|
2014-01-08 15:19:10 +01:00
|
|
|
mongod --maxConns 32 --nojournal --noprealloc --smallfiles --quiet --noauth --port ${MONGO_PORT} --dbpath "${MONGO_DATA}" --bind_ip localhost --config /dev/null &>${MONGO_DATA}/out &
|
2013-07-15 19:54:31 +02:00
|
|
|
# Wait for Mongo to start listening to connections
|
2014-08-29 13:33:30 +02:00
|
|
|
wait_for_line "waiting for connections on port ${MONGO_PORT}" ${MONGO_DATA}/out
|
2013-07-15 19:54:31 +02:00
|
|
|
# Read the fifo for ever otherwise mongod would block
|
2013-07-25 13:51:48 +03:00
|
|
|
cat ${MONGO_DATA}/out > /dev/null &
|
2013-09-09 11:04:34 +02:00
|
|
|
export CEILOMETER_TEST_MONGODB_URL="mongodb://localhost:${MONGO_PORT}/ceilometer"
|
2014-08-19 17:14:17 +04:00
|
|
|
if test -n "$CEILOMETER_TEST_HBASE_URL"
|
|
|
|
then
|
|
|
|
export CEILOMETER_TEST_HBASE_TABLE_PREFIX=$(hexdump -n 16 -v -e '/1 "%02X"' /dev/urandom)
|
|
|
|
python tools/test_hbase_table_utils.py --upgrade
|
|
|
|
fi
|
2014-02-09 16:36:07 +02:00
|
|
|
|
|
|
|
# Yield execution to venv command
|
|
|
|
$*
|