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 TestName="2drive-swap-test"
18 scripts/copy-2disk-drive-confs
19 scripts/prepare-disk-changer
22 change_jobname NightlySave $JobName
25 echo "${cwd}/build" >${cwd}/tmp/file-list
27 # Turn off Prefer Mounted Volumes so we use 2 drives
28 outf="${cwd}/tmp/sed_tmp"
29 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
30 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
31 # Comment the next line out to write everything to one drive
32 # otherwise, it writes the two jobs to different drives
33 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
35 # Write out bconsole commands
36 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
39 @$out ${cwd}/tmp/log1.out
40 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=0
41 label storage=tape volume=TestVolume002 slot=2 Pool=Default drive=1
43 @#setdebug level=120 storage=tape
44 run job=$JobName level=Full yes
46 run job=$JobName level=Full yes
50 update volume=TestVolume001 maxvolbytes=40123123
51 setdebug level=150 storage=tape
52 run job=$JobName level=Full yes
62 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
67 @$out ${cwd}/tmp/log2.out
68 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
76 check_for_zombie_jobs storage=tape