3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Label two tapes, write to the first, then recycle it and destroy
9 # the header. Bacula should discover that, mark the tape in
10 # error and continue onto the second tape.
12 TestName="bad-label-changer"
13 JobName=badlabelchanger
20 scripts/copy-2tape-confs
21 scripts/prepare-two-tapes
23 echo "${cwd}/build" >${cwd}/tmp/file-list
26 #echo "s%# Maximum File Size% Maximum File Size%g" >${outf}
27 #cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
28 #sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
30 change_jobname $JobName
33 # Write out bconsole commands
34 cat <<END_OF_DATA >tmp/bconcmds
38 label storage=tape volume=TestVolume002 slot=$SLOT2 pool=Default drive=$DRIVE1
39 label storage=tape volume=TestVolume001 slot=$SLOT1 pool=Default drive=$DRIVE1
41 @#setdebug level=10 client=$CLIENT
42 setdebug level=150 storage=tape
45 purge volume=TestVolume001
51 check_for_zombie_jobs storage=tape
54 # Overwrite TestVolume001 label
55 init_drive ${TAPE_DRIVE}
57 cat <<END_OF_DATA >tmp/bconcmds
61 run job=$JobName level=Full storage=tape yes
68 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
76 check_for_zombie_jobs storage=tape