]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-volume-test
Copy trunk regress into Branch
[bacula/bacula] / regress / tests / two-volume-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory 
4 #  to two tapes where the maximum tape file size is set to 1M
5 #  Note, this test simulates the tape filling and writing to
6 #   the next tape.
7 #
8 #  Note we use the viritual disk autochanger
9 #
10 TestName="two-volume-test"
11 JobName=TwoVolume
12 . scripts/functions
13
14 cwd=`pwd`
15 scripts/cleanup
16 scripts/copy-2disk-confs
17 scripts/prepare-two-disks
18  
19 echo "${cwd}/build" >${cwd}/tmp/file-list
20
21 outf="tmp/sed_tmp"
22 echo "s%# Maximum File Size%  Maximum File Size%g" >${outf}
23 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
24 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
25
26 change_jobname NightlySave $JobName
27 start_test
28
29 # Write out bconsole commands
30 cat <<END_OF_DATA >tmp/bconcmds
31 @$out /dev/null
32 messages
33 @$out tmp/log1.out
34 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Default drive=0
35 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
36 update Volume=TestVolume001 MaxVolBytes=3000000 pool=Default drive=0
37 sql                               
38 select * from Storage;
39 select VolumeName,InChanger,StorageId from Media;
40
41 @#setdebug level=1000 client 
42 run job=$JobName yes
43 wait
44 update slots scan storage=DDS-4
45 sql                               
46 select * from Storage;
47 select VolumeName,InChanger,StorageId from Media;
48
49 messages
50 @# 
51 @# now do a restore
52 @#
53 @$out tmp/log2.out
54 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
55 yes
56 wait
57 messages
58 @$out
59 quit
60 END_OF_DATA
61
62 run_bacula
63 check_for_zombie_jobs storage=DDS-4
64 stop_bacula
65
66 check_two_logs
67 check_restore_diff
68 end_test