3 # Test for a tape truncation bug.
7 scripts/copy-tape-confs
9 echo "${cwd}/build" >/tmp/file-list
13 echo " === Starting truncate-bug-tape test at `date +%R:%S` ==="
14 echo " === Starting truncate-bug-tape test at `date +%R:%S` ===" >>working/log
17 bin/bacula start 2>&1 >/dev/null
18 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
22 label storage=DDS-4 volume=TestVolume001 slot=0
23 @# do a bunch of saves so we have 12 files on the tape
24 run job=NightlySave yes
25 run level=Full job=NightlySave yes
26 run level=Full job=NightlySave yes
27 run level=Full job=NightlySave yes
28 run level=Full job=NightlySave yes
29 run level=Full job=NightlySave yes
30 run level=Full job=NightlySave yes
31 run level=Full job=NightlySave yes
32 run level=Full job=NightlySave yes
33 run level=Full job=NightlySave yes
34 run level=Full job=NightlySave yes
35 run level=Full job=NightlySave yes
40 scripts/check_for_zombie_jobs storage=DDS-4
41 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
48 restore where=${cwd}/tmp/bacula-restores storage=DDS-4
50 @# select JobId=4 (i.e. file five on the tape)
62 scripts/check_for_zombie_jobs storage=DDS-4
63 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
67 run level=Full job=NightlySave yes
72 bin/bacula stop 2>&1 >/dev/null
73 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
75 grep "^ Termination: *Backup OK" tmp/log2.out 2>&1 >/dev/null
77 if [ $bstat != 0 -o $rstat != 0 ] ; then
80 echo " !!!!! truncate-bug-tape test Bacula source failed!!! !!!!! "
81 echo " !!!!! truncate-bug-tape test failed!!! !!!!! " >>test.out
84 echo " ===== truncate-bug-tape test Bacula source OK ===== "
85 echo " ===== truncate-bug-tape test OK ===== " >>test.out