]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/setup
Allow for optional parameter which specifies the database target.
[bacula/bacula] / regress / scripts / setup
1 #!/bin/sh
2 #
3 # Script to setup running Bacula regression tests
4 #
5 cwd=`pwd`
6 if [ $# != 4 ] ; then
7    echo "Incorrect number of arguments. Need:"
8    echo "setup bacula-src depkgs email-address --with-DBNAME"
9    echo " "
10    exit 1
11 fi
12 if [ ! -d $1 ] ; then
13    echo "Arg 1 must be a Bacula release directory."
14    echo " "
15    exit 1
16 fi
17 if [ ! -d $2 ] ; then
18    cd ..
19    cwd=`pwd`
20    echo "The regression scripts require DEPKGS as arg 2 but not found!" 
21    echo " "
22    exit 1
23 fi
24 rm -rf build bin
25 # Copy new source
26 cp -rp $1 build
27 cp scripts/regress-config build
28 cd build
29 rm -f Makefile config.cache
30 # Run Bacula configuration, make, install
31 ./regress-config ${cwd} $2 $3 $4
32 make
33 make install
34 cp src/tools/testls ../bin
35
36 cd ..
37 bin/bacula stop
38 cd bin
39 ./create_bacula_database
40 ./drop_bacula_tables
41 ./make_bacula_tables
42 ./grant_bacula_privileges
43 cd ..
44 # Start and stop Bacula to ensure conf files are OK
45 bin/bacula start
46 bin/bacula stop
47 #
48 # Save Bacula default conf files for later use
49 #
50 cp -f bin/*.conf scripts