deb-ceilometer/functions.sh
Joe H. Rahme 1278d067ef Run unit tests against MySQL
- Creates a new tox environment for testing against mysql
- Adds a script set-test-env-mysql.sh to set up mysql
- Adds a new file `functions.sh` for common shell functions
- Creates a new DB manager for tests
- Adds a new scenario for mysql in the MixinTestsWithBackendScenarios

Related to blueprint sql-unit-tests-on-real-backend
Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>

Change-Id: I2c7378c79b1a0bffae5b2489b04c60e509f62f85
2014-10-01 10:26:27 +02:00

29 lines
560 B
Bash

function clean_exit(){
local error_code="$?"
if test -n "$CEILOMETER_TEST_HBASE_URL"
then
python tools/test_hbase_table_utils.py --clear
fi
rm -rf "$1"
kill $(jobs -p)
return $error_code
}
check_for_cmd () {
if ! which "$1" >/dev/null 2>&1
then
echo "Could not find $1 command" 1>&2
exit 1
fi
}
wait_for_line () {
while read line
do
echo "$line" | grep -q "$1" && break
done < "$2"
# Read the fifo for ever otherwise process would block
cat "$2" >/dev/null &
}