]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-volume-test
Update
[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 . config.out
14
15 cwd=`pwd`
16 scripts/cleanup
17 scripts/copy-2disk-confs
18 scripts/prepare-two-disks
19  
20 echo "${cwd}/build" >/tmp/file-list
21
22 outf="tmp/sed_tmp"
23 echo "s%# Maximum File Size%  Maximum File Size%g" >${outf}
24 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
25 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
26
27 change_jobname NightlySave $JobName
28 start_test
29
30 # Write out bconsole commands
31 cat <<END_OF_DATA >tmp/bconcmds
32 @$out /dev/null
33 messages
34 @$out tmp/log1.out
35 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Default drive=0
36 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
37 update Volume=TestVolume001 MaxVolBytes=3000000 pool=Default drive=0
38 sql                               
39 select * from Storage;
40 select VolumeName,InChanger,StorageId from Media;
41
42 @#setdebug level=1000 client 
43 run job=$JobName yes
44 wait
45 update slots scan storage=DDS-4
46 sql                               
47 select * from Storage;
48 select VolumeName,InChanger,StorageId from Media;
49
50 messages
51 @# 
52 @# now do a restore
53 @#
54 @$out tmp/log2.out
55 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
56 yes
57 wait
58 messages
59 @$out
60 quit
61 END_OF_DATA
62
63 run_bacula
64 check_for_zombie_jobs storage=DDS-4
65 stop_bacula
66
67 check_two_logs
68 check_restore_diff
69 end_test