3 # Script to setup running Bacula regression tests
9 echo "Bad exit code giving up"
17 if [ ! -d ${BACULA_SOURCE} ] ; then
18 echo "The BACULA_SOURCE environment variable must be a Bacula release directory, but is not."
23 MAKEOPTS=${MAKEOPT:-"-j3"}
26 # we build and setup binaries to the $cwd/bin directory not $bin
29 echo "Copying source from ${BACULA_SOURCE}"
30 cp -rp ${BACULA_SOURCE} build
31 which git >/dev/null 2>/dev/null
33 git show HEAD | grep -m 1 commit | awk '{print $2}' > build/git-version
35 echo "Git not found." >build/git-version
38 # In default bacula-dir.conf.in, change default file
39 # to backup to be build directory
40 echo "s%File = @sbindir@%File = @BUILD_DIR@%g" >tmp/t$$
41 sed -f tmp/t$$ build/src/dird/bacula-dir.conf.in >tmp/o$$
42 cp tmp/o$$ build/src/dird/bacula-dir.conf.in
44 # remove unneeded directories
45 rm -rf build/txt build/src/testprogs
46 sed -f tmp/sed_tmp scripts/regress-config.in >scripts/regress-config
47 chmod 755 scripts/regress-config
48 cp scripts/regress-config build
50 rm -f Makefile config.*
51 # Run Bacula configuration, make, install
52 ./regress-config ${cwd}
54 # Cleanup any build in source
59 if [ a${KEEP_SOURCE} = a ]; then
60 rm -rf examples patches
62 # eliminate non-essential directories to reduce
63 # size. Otherwise regress run too long
64 rm -rf src/win32 examples patches
66 # get all tools -- especially testls
76 echo "Running database creation scripts"
77 ./create_bacula_database
80 ./grant_bacula_privileges
82 # Start and stop Bacula to ensure conf files are OK
86 # Save Bacula default conf files for later use
88 cp -f bin/*.conf scripts