3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Test for a tape truncation bug.
10 TestName="truncate-bug-tape"
16 scripts/copy-tape-confs
19 echo "${cwd}/build" >${cwd}/tmp/file-list
21 change_jobname NightlySave $JobName
24 cat <<END_OF_DATA >tmp/bconcmds
28 label storage=tape volume=TestVolume001 slot=0 pool=Default
29 @# do a bunch of saves so we have 12 files on the tape
30 @#setdebug level=100 dir
31 setdebug level=50 storage=tape
33 run level=Full job=$JobName yes
34 run level=Full job=$JobName yes
35 run level=Full job=$JobName yes
36 run level=Full job=$JobName yes
37 run level=Full job=$JobName yes
38 run level=Full job=$JobName yes
39 run level=Full job=$JobName yes
40 run level=Full job=$JobName yes
41 run level=Full job=$JobName yes
42 run level=Full job=$JobName yes
43 run level=Full job=$JobName yes
50 scripts/check_for_zombie_jobs storage=tape
52 cat <<END_OF_DATA >tmp/bconcmds
59 restore where=${cwd}/tmp/bacula-restores storage=tape
61 @# select JobId=4 (i.e. file five on the tape)
74 scripts/check_for_zombie_jobs storage=tape
76 # Now write to tape one more time
77 cat <<END_OF_DATA >tmp/bconcmds
81 run level=Full job=$JobName yes
88 check_for_zombie_jobs storage=tape
92 grep "^ Termination: *Backup OK" tmp/log3.out 2>&1 >/dev/null