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