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