]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/setup
Tweaks
[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
23 # we build and setup binaries to the $cwd/bin directory not $bin
24 rm -rf build bin
25 # Copy new source
26 echo "Copying source from ${BACULA_SOURCE}"
27 cp -rp ${BACULA_SOURCE} build
28 check_exit_code
29 scripts/create_sed
30 sed -f tmp/sed_tmp scripts/regress-config.in >scripts/regress-config
31 chmod 755 scripts/regress-config
32 cp scripts/regress-config build
33 cd build
34 rm -f Makefile config.cache
35 # Run Bacula configuration, make, install
36 ./regress-config ${cwd}
37 check_exit_code
38 # Cleanup any build in source
39 make clean
40 make -j3
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
54 ./drop_bacula_tables
55 ./make_bacula_tables
56 ./grant_bacula_privileges
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