]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/setup
ebl update for next-vol test
[bacula/bacula] / regress / scripts / setup
index 242291e8656a0a979dd2fb992cc0614be57cf9b8..d9dc1533ec150f1ed22549d7b03f6ab9853beca1 100755 (executable)
@@ -2,42 +2,59 @@
 #
 # Script to setup running Bacula regression tests
 #
+
+check_exit_code()
+{
+   if [ $? != 0 ] ; then
+      echo "Bad exit code giving up"
+      exit 1 
+   fi
+}
+
+. ./config
+
 cwd=`pwd`
-if [ $# != 1 ] ; then
-   echo "Arg 1 must be a Bacula release directory."
-   echo " "
-   exit 1
-fi
-if [ ! -d $1 ] ; then
-   echo "Arg 1 must be a Bacula release directory."
-   echo " "
-   exit 1
-fi
-if [ ! -d ../depkgs ] ; then
-   cd ..
-   cwd=`pwd`
-   echo "The regression scripts require ${cwd}/depkgs but not found!" 
+if [ ! -d ${BACULA_SOURCE} ] ; then
+   echo "The BACULA_SOURCE environment variable must be a Bacula release directory, but is not."
    echo " "
    exit 1
 fi
 rm -rf build bin
-cp -rp $1 build
+# Copy new source
+echo "Copying source from ${BACULA_SOURCE}"
+cp -rp ${BACULA_SOURCE} build
 cp scripts/regress-config build
 cd build
+rm -f Makefile config.cache
+# Run Bacula configuration, make, install
 ./regress-config ${cwd}
-make
+check_exit_code
+# Cleanup any win32 build in source
+cd src/win32
+make clean
+cd ../..
+make -j3
+check_exit_code
 make install
+check_exit_code
 cp src/tools/testls ../bin
+check_exit_code
 
-cd ..
+cd ${cwd}
 bin/bacula stop
-bin/create_sqlite_database
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
+
+mkdir -p working
+cd bin
+echo "Running database creation scripts"
+./create_bacula_database
+./drop_bacula_tables
+./make_bacula_tables
+./grant_bacula_privileges
+cd ${cwd}
+# Start and stop Bacula to ensure conf files are OK
 bin/bacula start
 bin/bacula stop
 #
 # Save Bacula default conf files for later use
 #
 cp -f bin/*.conf scripts
-scripts/do_sed