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