]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/setup
Updates
[bacula/bacula] / regress / scripts / setup
index 4bc14086195a63ac3ac25258341cc1c317152831..3ab7ce3dc5f0ce5a870fda0445d9870f309942fc 100755 (executable)
@@ -2,10 +2,19 @@
 #
 # 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
-   echo "Incorrect number of arguments. Need:"
-   echo "setup bacula-src depkgs email-address --with-DBNAME"
+if [ $# != 6 ] ; then
+   echo "Incorrect number of arguments. Got $#. Need:"
+   echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
    echo " "
    exit 1
 fi
@@ -14,33 +23,34 @@ if [ ! -d $1 ] ; then
    echo " "
    exit 1
 fi
-if [ ! -d $2 ] ; then
-   cd ..
-   cwd=`pwd`
-   echo "The regression scripts require DEPKGS as arg 2 but not found!" 
-   echo " "
-   exit 1
-fi
 rm -rf build bin
 # Copy new source
+echo "Copying source from $1"
 cp -rp $1 build
 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