]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bsr-opt-test
Add bsr optimize test
[bacula/bacula] / regress / tests / bsr-opt-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   split the archive into two volumes, then restore
5 #   files on only one of the volumes and ensure that
6 #   the other volume is not used.
7 #
8 cwd=`pwd`
9 scripts/copy-test-confs
10 scripts/cleanup
11 echo "${cwd}/build" >/tmp/file-list
12 bin/bacula stop 2>&1 >/dev/null
13 bin/drop_sqlite_tables
14 bin/make_sqlite_tables
15
16 echo " "
17 echo " "
18 echo " === Starting bsr-opt-test  ==="
19 echo " === Starting bsr-opt-test  ===" >working/log
20 echo " "
21
22 bin/bacula start 2>&1 >/dev/null
23 bin/console -c bin/console.conf <<END_OF_DATA
24 @output /dev/null
25 messages
26 @output tmp/log1.out
27 label storage=File1
28 TestVolume001
29 label storage=File1
30 TestVolume002
31 update Volume=TestVolume001
32 6
33 3000000
34 10
35 run job=NightlySave storage=File1
36 yes
37 wait
38 messages
39 @# 
40 @# now do a restore
41 @#
42 @output tmp/log2.out
43 restore where=${cwd}/tmp/bacula-restores current
44 unmark *
45 cd ${cwd}/build/src/cats
46 mark *
47 ls
48 done
49 yes
50 wait
51 messages
52 @output
53 quit
54 END_OF_DATA
55 bin/bacula stop 2>&1 >/dev/null
56 grep TestVolume001 working/restore.bsr
57 bsrstat=$?
58 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
59 bstat=$?
60 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
61 rstat=$?
62 diff -r build/src/cats  tmp/bacula-restores${cwd}/build/src/cats
63 if [ $? != 0 -o $bsrstat != 1 -o $bstat != 0 -o $rstat != 0 ] ; then
64    echo " "
65    echo " "
66    echo "  !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
67    echo "  !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
68    echo " "
69 else
70    echo "  ===== bsr-opt-test Bacula source OK ===== "
71    echo "  ===== bsr-opt-test OK ===== " >>test.out
72    scripts/cleanup
73 fi