3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Set prefer mounted volumes to no to try to force use of
11 # This script uses the virtual disk autochanger and two drives
13 # It tests starting job 1, which will not complete because FD is
14 # offline, then starting job 2, which wants to swap the volume.
16 TestName="2drive-offline"
17 JobName="2driveoffline"
21 scripts/copy-2disk-drive-confs
22 scripts/prepare-disk-changer
25 change_jobname NightlySave $JobName
28 echo "${cwd}/build" >${cwd}/tmp/file-list
30 # Turn off Prefer Mounted Volumes so we use 2 drives
31 outf="${cwd}/tmp/sed_tmp"
32 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
33 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
34 # Comment the next line out to write everything to one drive
35 # otherwise, it writes the two jobs to different drives
36 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
38 # Write out bconsole commands
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
42 @$out ${cwd}/tmp/log1.out
43 label storage=tape volume=TestVolume001 slot=2 Pool=Default drive=0
44 label storage=tape volume=TestVolume002 slot=1 Pool=Default drive=1
46 setdebug level=120 storage=tape
47 run job=Offline level=Full yes
49 run job=$JobName level=Full yes
61 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
66 @$out ${cwd}/tmp/log2.out
67 @#unmount storage=tape drive=0
68 @#unmount storage=tape drive=1
69 @#mount storage=tape slot=1 drive=0
70 @#mount storage=tape slot=2 drive=1
71 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
79 check_for_zombie_jobs storage=tape