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