]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/span-vol-test
Final changes
[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 cd bin
14 ./drop_bacula_tables >/dev/null 2>&1
15 ./make_bacula_tables >/dev/null 2>&1
16 ./grant_bacula_privileges 2>&1 >/dev/null
17 cd ..
18
19 echo " "
20 echo " "
21 echo " === Starting span-vol-test  ==="
22 echo " === Starting span-vol-test  ===" >working/log
23 echo " "
24
25 bin/bacula start 2>&1 >/dev/null
26 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
27 @output /dev/null
28 messages
29 @output tmp/log1.out
30 label storage=File1 volume=TestVolume001
31 label storage=File1 volume=TestVolume002
32 label storage=File1 volume=TestVolume003
33 label storage=File1 volume=TestVolume004
34 update Volume=TestVolume001 MaxVolBytes=3000000
35 update Volume=TestVolume002 MaxVolBytes=3000000
36 update Volume=TestVolume003 MaxVolBytes=3000000
37 run job=NightlySave storage=File1 yes
38 wait
39 list volumes
40 messages
41 @# 
42 @# now do a restore
43 @#
44 @output tmp/log2.out
45 restore where=${cwd}/tmp/bacula-restores select storage=File1
46 unmark *
47 mark *
48 done
49 yes
50 wait
51 messages
52 @output
53 quit
54 END_OF_DATA
55 scripts/check_for_zombie_jobs storage=File1
56 bin/bacula stop 2>&1 >/dev/null
57 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
58 bstat=$?
59 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
60 rstat=$?
61 diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
62 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
63    echo " "
64    echo " "
65    echo "  !!!!! span-vol-test Bacula source failed!!! !!!!! "
66    echo "  !!!!! span-vol-test failed!!! !!!!! " >>test.out
67    echo " "
68 else
69    echo "  ===== span-vol-test Bacula source OK ===== "
70    echo "  ===== span-vol-test OK ===== " >>test.out
71    scripts/cleanup
72 fi