3 # Run a job with a limited tape size so that the tape fills up.
4 # Then manually unload the tape and load a new one, label
7 TestName="two-vol-manual-tape"
8 JobName=twovolmanualtape
15 scripts/copy-tape-confs
16 echo "${cwd}/build" >${cwd}/tmp/file-list
18 # Get a tape in the drive either from slot 1 or slot 2
19 slot=`bin/mtx-changer ${AUTOCHANGER} loaded 0 ${TAPE_DRIVE} $DRIVE1`
22 bin/mtx-changer ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
32 mt -f ${TAPE_DRIVE} rewind
33 bin/mtx-changer ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
34 bin/mtx-changer ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
38 mt -f ${TAPE_DRIVE} rewind
39 mt -f ${TAPE_DRIVE} weof
42 change_jobname $JobName
45 # Write out bconsole commands
46 cat <<END_OF_DATA >tmp/bconcmds
50 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default drive=0
51 update Volume=TestVolume001 MaxVolBytes=4000000 pool=Default drive=0
53 select * from Storage;
54 select VolumeName,InChanger,StorageId from Media;
56 @#setdebug level=150 storage=DDS-4
58 @# This sleep must be long enough for the first tape to fill (4MB)
59 @# otherwise the following mtx-changer commands will fail
62 select * from Storage;
63 select VolumeName,InChanger,StorageId from Media;
75 mt -f ${TAPE_DRIVE} rewind
78 bin/mtx-changer ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
79 bin/mtx-changer ${AUTOCHANGER} load $SLOT2 ${TAPE_DRIVE} $DRIVE1
82 bin/mtx-changer ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
83 bin/mtx-changer ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
86 echo "Something went wrong. Expected $SLOT1 or $SLOT2, got $slot"
90 mt -f ${TAPE_DRIVE} rewind
91 mt -f ${TAPE_DRIVE} weof
93 # second half of job -- write on next tape
94 cat <<END_OF_DATA >tmp/bconcmds
96 label storage=DDS-4 volume=TestVolume002 slot=0 pool=Default drive=0
101 @#restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
115 check_for_zombie_jobs storage=DDS-4