]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-vol-test
Final changes
[bacula/bacula] / regress / tests / two-vol-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   split the archive into two volumes
5 #
6 cwd=`pwd`
7 scripts/copy-test-confs
8 scripts/cleanup
9 echo "${cwd}/build" >/tmp/file-list
10
11 echo " "
12 echo " "
13 echo " === Starting two-vol-test  ==="
14 echo " === Starting two-vol-test  ===" >working/log
15 echo " "
16
17 bin/bacula start 2>&1 >/dev/null
18 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
19 @output /dev/null
20 messages
21 @output tmp/log1.out
22 label storage=File1 volume=TestVolume001
23 label storage=File1 volume=TestVolume002
24 update Volume=TestVolume001 MaxVolBytes=3000000
25 run job=NightlySave storage=File1 yes
26 wait
27 messages
28 @# 
29 @# now do a restore
30 @#
31 @output tmp/log2.out
32 restore where=${cwd}/tmp/bacula-restores select all storage=File1 done
33 yes
34 wait
35 messages
36 @output
37 quit
38 END_OF_DATA
39 scripts/check_for_zombie_jobs storage=File1
40 bin/bacula stop 2>&1 >/dev/null
41 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
42 bstat=$?
43 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
44 rstat=$?
45 diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
46 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
47    echo " "
48    echo " "
49    echo "  !!!!! two-vol-test Bacula source failed!!! !!!!! "
50    echo "  !!!!! two-vol-test failed!!! !!!!! " >>test.out
51    echo " "
52 else
53    echo "  ===== two-vol-test Bacula source OK ===== "
54    echo "  ===== two-vol-test OK ===== " >>test.out
55    scripts/cleanup
56 fi