]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/span-vol-test
Misc
[bacula/bacula] / regress / tests / span-vol-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   split the archive into four volumes, two of which are
5 #   totally full. I.e. make sure that bsr selects all tapes 
6 #   including those fully spanned.
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 span-vol-test  ==="
19 echo " === Starting span-vol-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 volume=TestVolume001
28 label storage=File1 volume=TestVolume002
29 label storage=File1 volume=TestVolume003
30 label storage=File1 volume=TestVolume004
31 update Volume=TestVolume001 MaxVolBytes=3000000
32 update Volume=TestVolume002 MaxVolBytes=3000000
33 update Volume=TestVolume003 MaxVolBytes=3000000
34 run job=NightlySave storage=File1 yes
35 wait
36 list volumes
37 messages
38 @# 
39 @# now do a restore
40 @#
41 @output tmp/log2.out
42 restore where=${cwd}/tmp/bacula-restores current all
43 yes
44 wait
45 messages
46 @output
47 quit
48 END_OF_DATA
49 bin/bacula stop 2>&1 >/dev/null
50 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
51 bstat=$?
52 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
53 rstat=$?
54 diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
55 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
56    echo " "
57    echo " "
58    echo "  !!!!! span-vol-test Bacula source failed!!! !!!!! "
59    echo "  !!!!! span-vol-test failed!!! !!!!! " >>test.out
60    echo " "
61 else
62    echo "  ===== span-vol-test Bacula source OK ===== "
63    echo "  ===== span-vol-test OK ===== " >>test.out
64    scripts/cleanup
65 fi