3 # Run a simple backup of the Bacula build directory. Create three
4 # tapes, each in a different pool, then run two jobs both of which
5 # want the disk that is not loaded. Note, they both have
6 # prefers non-mounted tapes. This should expose bug #801
8 # This test the SD Virtual autochanger feature. It is a disk based
9 # "autochanger", but does not use any changer script.
11 # This script uses the Virtual disk autochanger and two drives
13 TestName="virtual-changer-disk"
14 JobName="virtualchangerdisk"
18 scripts/copy-2disk-drive-confs
19 scripts/prepare-disk-changer
23 echo "${cwd}/build" >${cwd}/tmp/file-list
24 echo "${cwd}/build" >>${cwd}/tmp/file-list
25 echo "${cwd}/build" >>${cwd}/tmp/file-list
26 echo "${cwd}/build" >>${cwd}/tmp/file-list
27 echo "${cwd}/build" >>${cwd}/tmp/file-list
28 echo "${cwd}/build" >>${cwd}/tmp/file-list
29 #change_jobname Virtual $JobName
32 # Turn off Prefer Mounted Volumes so we use 2 drives
33 outf="${cwd}/tmp/sed_tmp"
34 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
35 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
36 # Comment the next line out to write everything to one drive
37 # otherwise, it writes the two jobs to different drives
38 #sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
40 # Write out bconsole commands
41 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
44 @$out ${cwd}/tmp/log1.out
45 setdebug level=10 storage=Virtual
46 @#setdebug level=200 client=$CLIENT
47 label storage=Virtual volume=TestVolume001 slot=1 Pool=Default drive=0
48 label storage=Virtual volume=TestVolume002 slot=2 Pool=Full drive=0
49 label storage=Virtual volume=TestVolume003 slot=3 Pool=Inc drive=1
50 label storage=Virtual volume=TestVolume004 slot=4 Pool=Default drive=0
51 status storage=Virtual
52 run job=Virtual level=Full Pool=Default yes
53 run job=Virtual level=Full Pool=Default yes
54 run job=Virtual level=Full Pool=Default yes
55 run job=Virtual level=Full Pool=Default yes
56 run job=Virtual level=Full Pool=Default yes
57 run job=Virtual level=Full Pool=Default yes
58 run job=Virtual level=Full Pool=Default yes
59 run job=Virtual level=Full Pool=Default yes
60 run job=Virtual level=Full Pool=Default yes
61 status storage=Virtual
64 status storage=Virtual
67 status storage=Virtual
70 status storage=Virtual
73 status storage=Virtual
76 status storage=Virtual
79 status storage=Virtual
82 status storage=Virtual
85 status storage=Virtual
88 status storage=Virtual
91 status storage=Virtual
94 status storage=Virtual
97 status storage=Virtual
100 status storage=Virtual
106 status storage=Virtual
115 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
121 @$out ${cwd}/tmp/log2.out
122 restore where=${cwd}/tmp/bacula-restores select all storage=Virtual done
132 check_for_zombie_jobs storage=Virtual