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 # we build and setup binaries to the $cwd/bin directory not $bin
26 echo "Copying source from ${BACULA_SOURCE}"
27 cp -rp ${BACULA_SOURCE} build
28 git show HEAD | grep -m 1 commit | awk '{print $2}' > build/git-version
30 # In default bacula-dir.conf.in, change default file
31 # to backup to be build directory
32 echo "s%File = @sbindir@%File = @BUILD_DIR@%g" >tmp/t$$
33 sed -f tmp/t$$ build/src/dird/bacula-dir.conf.in >tmp/o$$
34 cp tmp/o$$ build/src/dird/bacula-dir.conf.in
36 # remove unneeded directories
37 rm -rf build/txt build/src/testprogs
38 sed -f tmp/sed_tmp scripts/regress-config.in >scripts/regress-config
39 chmod 755 scripts/regress-config
40 cp scripts/regress-config build
42 rm -f Makefile config.cache
43 # Run Bacula configuration, make, install
44 ./regress-config ${cwd}
46 # Cleanup any build in source
51 rm -rf examples patches
53 # eliminate non-essential directories to reduce
54 # size. Otherwise regress run too long
55 rm -rf src/win32 examples patches
56 # get all tools -- especially testls
66 echo "Running database creation scripts"
67 ./create_bacula_database
70 ./grant_bacula_privileges
72 # Start and stop Bacula to ensure conf files are OK
76 # Save Bacula default conf files for later use
78 cp -f bin/*.conf scripts