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
17 MTX=$AUTOCHANGER_SCRIPT
19 init_slot $TAPE_DRIVE $SLOT1
20 init_slot $TAPE_DRIVE $SLOT2
22 # Get a tape in the drive either from slot 1 or slot 2
23 slot=`bin/$MTX ${AUTOCHANGER} loaded 0 ${TAPE_DRIVE} $DRIVE1`
26 bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
36 bin/$MTX ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
37 bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
42 init_drive ${TAPE_DRIVE}
44 change_jobname $JobName
47 # Write out bconsole commands
48 cat <<END_OF_DATA >tmp/bconcmds
52 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default drive=0
53 update Volume=TestVolume001 MaxVolBytes=4000000 pool=Default drive=0
55 select * from Storage;
56 select VolumeName,InChanger,StorageId from Media;
58 @#setdebug level=150 storage=DDS-4
60 @# This sleep must be long enough for the first tape to fill (4MB)
61 @# otherwise the following mtx-changer commands will fail
64 select * from Storage;
65 select VolumeName,InChanger,StorageId from Media;
79 bin/$MTX ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
80 bin/$MTX ${AUTOCHANGER} load $SLOT2 ${TAPE_DRIVE} $DRIVE1
83 bin/$MTX ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1
84 bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1
87 echo "Something went wrong. Expected $SLOT1 or $SLOT2, got $slot"
91 init_drive ${TAPE_DRIVE}
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