]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/setup
Extend idea of Prefer Mounted Volumes to mean a volume about
[bacula/bacula] / regress / scripts / setup
1 #!/bin/sh
2 #
3 # Script to setup running Bacula regression tests
4 #
5
6 check_exit_code()
7 {
8    if [ $? != 0 ] ; then
9       echo "Bad exit code giving up"
10       exit 1 
11    fi
12 }
13
14 cwd=`pwd`
15 if [ $# != 6 ] ; then
16    echo "Incorrect number of arguments. Got $#. Need:"
17    echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
18    echo " "
19    exit 1
20 fi
21 if [ ! -d $1 ] ; then
22    echo "Arg 1 must be a Bacula release directory."
23    echo " "
24    exit 1
25 fi
26 rm -rf build bin
27 # Copy new source
28 echo "Copying source from $1"
29 cp -rp $1 build
30 cp scripts/regress-config build
31 cd build
32 rm -f Makefile config.cache
33 # Run Bacula configuration, make, install
34 ./regress-config ${cwd} $2 $3 $4 $5 $6
35 check_exit_code
36 # Cleanup any win32 build in source
37 cd src/win32
38 make clean
39 cd ../..
40 make
41 check_exit_code
42 make install
43 check_exit_code
44 cp src/tools/testls ../bin
45 check_exit_code
46
47 cd ${cwd}
48 bin/bacula stop
49
50 mkdir -p working
51 cd bin
52 echo "Running database creation scripts"
53 ./create_bacula_database bacula
54 ./drop_bacula_tables bacula
55 ./make_bacula_tables
56 ./grant_bacula_privileges bacula
57 cd ${cwd}
58 # Start and stop Bacula to ensure conf files are OK
59 bin/bacula start
60 bin/bacula stop
61 #
62 # Save Bacula default conf files for later use
63 #
64 cp -f bin/*.conf scripts