3 # Set prefer mounted volumes to no to try to force use of
6 # This script uses the virtual disk autochanger and two drives
8 # It tests starting job 1, which will not complete because FD is
9 # offline, then starting job 2, which wants to swap the volume.
11 TestName="2drive-offline"
12 JobName="2driveoffline"
16 scripts/copy-2disk-drive-confs
17 scripts/prepare-disk-changer
20 change_jobname NightlySave $JobName
23 echo "${cwd}/build" >${cwd}/tmp/file-list
25 # Turn off Prefer Mounted Volumes so we use 2 drives
26 outf="${cwd}/tmp/sed_tmp"
27 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
28 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
29 # Comment the next line out to write everything to one drive
30 # otherwise, it writes the two jobs to different drives
31 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
33 # Write out bconsole commands
34 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
37 @$out ${cwd}/tmp/log1.out
38 label storage=tape volume=TestVolume001 slot=2 Pool=Default drive=0
39 label storage=tape volume=TestVolume002 slot=1 Pool=Default drive=1
41 setdebug level=120 storage=tape
42 run job=Offline level=Full yes
44 run job=$JobName level=Full yes
56 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
61 @$out ${cwd}/tmp/log2.out
62 @#unmount storage=tape drive=0
63 @#unmount storage=tape drive=1
64 @#mount storage=tape slot=1 drive=0
65 @#mount storage=tape slot=2 drive=1
66 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
74 check_for_zombie_jobs storage=tape