]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/setup
8292d8717fa612e4bdfced7717210a8224b6f768
[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 . ./config
15
16 cwd=`pwd`
17 if [ ! -d ${BACULA_SOURCE} ] ; then
18    echo "The BACULA_SOURCE environment variable must be a Bacula release directory, but is not."
19    echo " "
20    exit 1
21 fi
22 rm -rf build bin
23 # Copy new source
24 echo "Copying source from ${BACULA_SOURCE}"
25 cp -rp ${BACULA_SOURCE} build
26 cp scripts/regress-config build
27 cd build
28 rm -f Makefile config.cache
29 # Run Bacula configuration, make, install
30 ./regress-config ${cwd}
31 check_exit_code
32 # Cleanup any win32 build in source
33 cd src/win32
34 make clean
35 cd ../..
36 make
37 check_exit_code
38 make install
39 check_exit_code
40 cp src/tools/testls ../bin
41 check_exit_code
42
43 cd ${cwd}
44 bin/bacula stop
45
46 mkdir -p working
47 cd bin
48 echo "Running database creation scripts"
49 ./create_bacula_database bacula
50 ./drop_bacula_tables bacula
51 ./make_bacula_tables
52 ./grant_bacula_privileges bacula
53 cd ${cwd}
54 # Start and stop Bacula to ensure conf files are OK
55 bin/bacula start
56 bin/bacula stop
57 #
58 # Save Bacula default conf files for later use
59 #
60 cp -f bin/*.conf scripts