#
# Script to setup running Bacula regression tests
#
+
+check_exit_code()
+{
+ if [ $? != 0 ] ; then
+ echo "Bad exit code giving up"
+ exit 1
+ fi
+}
+
cwd=`pwd`
-if [ $# != 4 ] ; then
+if [ $# != 6 ] ; then
echo "Incorrect number of arguments. Got $#. Need:"
echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
echo " "
cp scripts/regress-config build
cd build
rm -f Makefile config.cache
-# Remove files that may be too big
-cd doc
-if [ -d latex ] ; then
- cd latex
- make clean
- cd ..
-fi
-if [ -d latex-fr ] ; then
- cd latex-fr
- make clean
- cd ..
-fi
-if [ -d images ] ; then
- cd images
- rm -f *.png *.jpg *.gif *.eps
- rm -rf hires
- cd ..
-fi
-cd ${cwd}/build
-if [ -d rescue/linux/cdrom/cdtree ] ; then
- cd rescue/linux/cdrom/cdtree
- rm -rf bacula-*
- cd ..
- rm -rf bootcd.iso
-fi
-cd ${cwd}/build
# Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3 $4
+./regress-config ${cwd} $2 $3 $4 $5 $6
+check_exit_code
+# Cleanup any win32 build in source
+cd src/win32
+make clean
+cd ../..
make
+check_exit_code
make install
+check_exit_code
cp src/tools/testls ../bin
+check_exit_code
-cd ..
+cd ${cwd}
bin/bacula stop
+
+mkdir -p working
cd bin
-./create_bacula_database
-./drop_bacula_tables
+echo "Running database creation scripts"
+./create_bacula_database bacula
+./drop_bacula_tables bacula
./make_bacula_tables
-./grant_bacula_privileges
-cd ..
+./grant_bacula_privileges bacula
+cd ${cwd}
# Start and stop Bacula to ensure conf files are OK
bin/bacula start
bin/bacula stop