3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory. Create three
9 # tapes, each in a different pool, then run two jobs both of which
10 # want the disk that is not loaded. Note, they both have
11 # prefers non-mounted tapes. This should expose bug #801
13 # This test the SD Virtual autochanger feature. It is a disk based
14 # "autochanger", but does not use any changer script.
16 TestName="big-virtual-changer"
17 JobName="bigvirtualchanger"
21 scripts/copy-2disk-drive-confs
22 scripts/prepare-disk-changer
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 echo "${cwd}/build" >>${cwd}/tmp/file-list
30 echo "${cwd}/build" >>${cwd}/tmp/file-list
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=10 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 label storage=Virtual volume=TestVolume004 slot=4 Pool=Default drive=0
54 status storage=Virtual
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 run job=Virtual level=Full Pool=Default yes
62 run job=Virtual level=Full Pool=Default yes
63 run job=Virtual level=Full Pool=Default yes
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
103 status storage=Virtual
109 status storage=Virtual
118 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
124 @$out ${cwd}/tmp/log2.out
125 restore where=${cwd}/tmp/bacula-restores select all storage=Virtual done
134 check_for_zombie_jobs storage=Virtual