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