3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a job with a limited tape size so that the tape fills up.
9 # Then manually unload the tape and load a new one, label
12 TestName="manual-two-vol-tape"
13 JobName=manualtwovolltape
20 scripts/copy-tape-confs
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22 MTX=$AUTOCHANGER_SCRIPT
24 # Sleep longer if real tape
25 if [ x${USE_VTAPE} = xyes ] ; then
35 init_slot $TAPE_DRIVE $SLOT1
36 init_slot $TAPE_DRIVE $SLOT2
40 init_drive ${TAPE_DRIVE}
42 change_jobname $JobName
46 cat <<END_OF_DATA >tmp/bconcmds
50 label storage=tape volume=TestVolume002 slot=0 pool=Default drive=0
59 init_drive ${TAPE_DRIVE}
61 # label first volume, and run first half of job
62 cat <<END_OF_DATA >tmp/bconcmds
64 label storage=tape volume=TestVolume001 slot=0 pool=Default drive=0
65 update Volume=TestVolume001 MaxVolBytes=500000 pool=Default drive=0
67 @#setdebug level=150 storage=tape
69 @# This sleep must be long enough for the first tape to fill (4MB)
70 @# otherwise the following mtx-changer commands will fail
72 wait mount timeout=180
85 cat <<END_OF_DATA >tmp/bconcmds
87 wait mount timeout=180
88 setdebug level=200 storage=tape
90 @# backup should continue
96 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
99 wait mount timeout=180
100 exec "sh -c 'load_other_slot $slot'"
108 # run second half of backup + restore
113 check_for_zombie_jobs storage=tape