From: Kern Sibbald Date: Fri, 16 Oct 2009 10:14:53 +0000 (+0200) Subject: Add Marco's run regression wrapper script X-Git-Tag: Release-5.0.0~285^2~1^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a6103e573abe09de9691767e7fb2223c27392323;p=bacula%2Fbacula Add Marco's run regression wrapper script --- diff --git a/regress/run_bacula_regression b/regress/run_bacula_regression new file mode 100755 index 0000000000..b20979191e --- /dev/null +++ b/regress/run_bacula_regression @@ -0,0 +1,133 @@ +#!/bin/ksh +# +# Small wrapper script for doing Bacula regression +# You will undoubtedly need to edit this to make it +# work on your configuration +# + +# +# Set this if you need to post via a proxy +# +#http_proxy="http://proxy.planets.elm.net:3128" +#export http_proxy + +# +# Set this to the regression area where a git clone is put. +# +BACULA_REGRESS_HOME="/bacula_regress" +export BACULA_REGRESS_HOME + +# +# Lets use the SUN compiler +# +CC="/usr/bin/cc" +CXX="/usr/bin/CC" +CFLAGS="-fast" +CXXFLAGS="-fast" + +export CC CXX CFLAGS CXXFLAGS + +# +# Regression script to run +# +REGRESSION_SCRIPT="./nightly-disk" + +run_regression() +{ + screen -S bacula_regression -d -m ${REGRESSION_SCRIPT} + while [ 1 ] + do + count=`screen -list 2>/dev/null | grep -c bacula_regression` + if [ ${count} -lt 1 ]; then + break + fi + + sleep 60 + done +} + +run_sqlite3_regression() +{ + # + # Run regression using sqlite3 + # + if [ -f /root/configs/config.sqlite3 ]; then + ln -sf /root/configs/config.sqlite3 config + if [ $? = 0 ]; then + run_regression + fi + fi +} + +run_postgresql_regression() +{ + # + # Run regression using postgresql + # + if [ -f /root/configs/config.postgresql ]; then + ln -sf /root/configs/config.postgresql config + if [ $? = 0 ]; then + run_regression + fi + fi +} + +run_mysql_regression() +{ + # + # Run regression using mysql + # + if [ -f /root/configs/config.mysql ]; then + ln -sf /root/configs/config.mysql config + if [ $? = 0 ]; then + run_regression + fi + fi +} + +usage() +{ + echo "Usage: $0 " + echo "Where action is :" + echo " all - run sqlite3, postgresql and mysql regressions." + echo " sqlite3 - run sqlite3 regressions." + echo " postgresql - run postgresql regressions." + echo " mysql - run mysql regressions." +} + +main() +{ + if [ $# -lt 1 ]; then + usage + exit 1 + fi + + . /etc/profile + + cd ${BACULA_REGRESS_HOME}/regress || exit 1 + + case $1 in + all) + run_sqlite3_regression + run_postgresql_regression + run_mysql_regression + ;; + sqlite3) + run_sqlite3_regression + ;; + postgresql) + run_postgresql_regression + ;; + mysql) + run_mysql_regression + ;; + *) + usage + exit 1 + ;; + esac + + exit 0 +} + +main $*