]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/truncate-bug-tape
Update new debugging method
[bacula/bacula] / regress / tests / truncate-bug-tape
1 #!/bin/sh
2 #
3 # Test for a tape truncation bug.
4 #
5 TestName="truncate-bug-tape" 
6 JobName=truncatebug
7 . scripts/functions
8
9 copy_tape_confs
10
11 echo "${cwd}/build" >/tmp/file-list
12
13 change_jobname NightlySave $JobName
14 start_test
15
16 cat <<END_OF_DATA >tmp/bconcmds
17 @output /dev/null
18 messages
19 @$out   tmp/log1.out
20 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
21 @# do a bunch of saves so we have 12 files on the tape
22 run job=$JobName yes
23 run level=Full job=$JobName yes
24 run level=Full job=$JobName yes
25 run level=Full job=$JobName yes
26 run level=Full job=$JobName yes
27 run level=Full job=$JobName yes
28 run level=Full job=$JobName yes
29 run level=Full job=$JobName yes
30 run level=Full job=$JobName yes
31 run level=Full job=$JobName yes
32 run level=Full job=$JobName yes
33 run level=Full job=$JobName yes
34 @#setdebug level=100 storage=DDS-4
35 wait
36 messages
37 quit
38 END_OF_DATA
39
40 run_bacula
41 scripts/check_for_zombie_jobs storage=DDS-4
42
43 cat <<END_OF_DATA >tmp/bconcmds
44 @output /dev/null
45 messages
46 @$out tmp/log2.out
47 @# 
48 @# now do a restore
49 @#
50 restore where=${cwd}/tmp/bacula-restores storage=DDS-4
51 3
52 @# select JobId=4 (i.e. file five on the tape)
53 4
54 cd ${cwd}/build
55 @# mark a single file
56 mark configure
57 done
58 yes
59 wait
60 messages
61 @output
62 quit
63 END_OF_DATA
64
65 run_bconsole
66 scripts/check_for_zombie_jobs storage=DDS-4
67
68 # Now write to tape one more time
69 cat <<END_OF_DATA >tmp/bconcmds
70 @output /dev/null
71 messages
72 @$out tmp/log3.out
73 run level=Full job=$JobName yes
74 wait
75 messages
76 quit
77 END_OF_DATA
78
79 run_bconsole
80 check_for_zombie_jobs storage=DDS-4
81 stop_bacula
82
83 check_two_logs
84 grep "^  Termination: *Backup OK" tmp/log3.out 2>&1 >/dev/null
85 dstat=$?
86 end_test