]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/setup
Fix initial SQlite Problem
[bacula/bacula] / regress / scripts / setup
index 1f8ba1b5d7a862a2a5f34fcae43ad3a2dbc60f91..3ab7ce3dc5f0ce5a870fda0445d9870f309942fc 100755 (executable)
@@ -2,8 +2,17 @@
 #
 # 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 " "
@@ -22,19 +31,26 @@ cp scripts/regress-config build
 cd build
 rm -f Makefile config.cache
 # Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3 $4
+./regress-config ${cwd} $2 $3 $4 $5 $6
+check_exit_code
 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