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 # Note, because we limit each drive to a maximum of 3 jobs,
12 # the first three start on Drive-0, and the second three start
13 # on drive-1 (Prefer Mounted Volumes = no). Thus since there
14 # is only one Volume (TestVolume001) that is valid, three jobs
15 # block and ask the user to create a new volume. However, at some
16 # point, the first three jobs finish and free up TestVolum001, and
17 # Since we set a poll interval of 15 seconds, after a short wait
18 # TestVolume001 will be mounted on drive-1 and the job will
19 # complete. This tests a good number of things.
21 TestName="virtual-changer-test"
22 JobName="virtualchangertest"
26 scripts/copy-2disk-drive-confs
27 scripts/prepare-disk-changer
31 echo "${cwd}/build" >${cwd}/tmp/file-list
32 #change_jobname Virtual $JobName
35 # Turn off Prefer Mounted Volumes so we use 2 drives
36 outf="${cwd}/tmp/sed_tmp"
37 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
38 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
39 # Comment the next line out to write everything to one drive
40 # otherwise, it writes the two jobs to different drives
41 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
43 # Write out bconsole commands
44 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
47 @$out ${cwd}/tmp/log1.out
48 setdebug level=200 storage=Virtual
49 @#setdebug level=200 client=$CLIENT
50 label storage=Virtual volume=TestVolume001 slot=1 Pool=Default drive=0
51 label storage=Virtual volume=TestVolume002 slot=2 Pool=Full drive=0
52 label storage=Virtual volume=TestVolume003 slot=3 Pool=Inc drive=1
53 status storage=Virtual
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
60 status storage=Virtual
65 status storage=Virtual
73 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
79 @$out ${cwd}/tmp/log2.out
80 restore where=${cwd}/tmp/bacula-restores select all storage=Virtual done
89 check_for_zombie_jobs storage=Virtual