]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/setup
Make sure to create bin/plugins so regress works
[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 rm -rf build bin
24 # Copy new source
25 echo "Copying source from ${BACULA_SOURCE}"
26 cp -rp ${BACULA_SOURCE} build
27 scripts/create_sed
28 sed -f tmp/sed_tmp scripts/regress-config.in >scripts/regress-config
29 chmod 755 scripts/regress-config
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}
35 check_exit_code
36 # Cleanup any win32 build in source
37 cd src/win32
38 make clean
39 cd ../..
40 make -j3
41 check_exit_code
42 make install
43 mkdir -p ../bin/plugins
44 check_exit_code
45 cp src/tools/testls ../bin
46 check_exit_code
47
48 cd ${cwd}
49 bin/bacula stop
50
51 mkdir -p working
52 cd bin
53 echo "Running database creation scripts"
54 ./create_bacula_database
55 ./drop_bacula_tables
56 ./make_bacula_tables
57 ./grant_bacula_privileges
58 cd ${cwd}
59 # Start and stop Bacula to ensure conf files are OK
60 bin/bacula start
61 bin/bacula stop
62 #
63 # Save Bacula default conf files for later use
64 #
65 cp -f bin/*.conf scripts