]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/setup
remove non-essential directories
[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 cd build
29 rm -rf txt src/testprogs
30 cd ..
31 check_exit_code
32 scripts/create_sed
33 sed -f tmp/sed_tmp scripts/regress-config.in >scripts/regress-config
34 chmod 755 scripts/regress-config
35 cp scripts/regress-config build
36 cd build
37 rm -f Makefile config.cache
38 # Run Bacula configuration, make, install
39 ./regress-config ${cwd}
40 check_exit_code
41 # Cleanup any build in source
42 make clean
43 make -j3
44 check_exit_code
45 make install
46 rm -rf examples patches
47 check_exit_code
48 # eliminate non-essential directories to reduce
49 #   size.  Otherwise regress run too long
50 rm -rf src/win32 examples patches
51 cp src/tools/testls ../bin
52 check_exit_code
53
54 cd ${cwd}
55 bin/bacula stop
56
57 mkdir -p working
58 cd bin
59 echo "Running database creation scripts"
60 ./create_bacula_database
61 ./drop_bacula_tables
62 ./make_bacula_tables
63 ./grant_bacula_privileges
64 cd ${cwd}
65 # Start and stop Bacula to ensure conf files are OK
66 bin/bacula start
67 bin/bacula stop
68 #
69 # Save Bacula default conf files for later use
70 #
71 cp -f bin/*.conf scripts