]> git.sur5r.net Git - bacula/bacula/commitdiff
Add Marco's run regression wrapper script
authorKern Sibbald <kern@sibbald.com>
Fri, 16 Oct 2009 10:14:53 +0000 (12:14 +0200)
committerKern Sibbald <kern@sibbald.com>
Fri, 16 Oct 2009 10:14:53 +0000 (12:14 +0200)
regress/run_bacula_regression [new file with mode: 0755]

diff --git a/regress/run_bacula_regression b/regress/run_bacula_regression
new file mode 100755 (executable)
index 0000000..b209791
--- /dev/null
@@ -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 <action>"
+   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 $*