]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/truncate-bug-tape
82b1cf54a80a6431720150bbbd835194eba56277
[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 set_debug 0
9
10 scripts/copy-tape-confs
11 scripts/cleanup-tape
12 echo "${cwd}/build" >/tmp/file-list
13
14 change_jobname $JobName
15 start_test
16
17 cat <<END_OF_DATA >tmp/bconcmds
18 @output /dev/null
19 messages
20 @$out   tmp/log1.out
21 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
22 @# do a bunch of saves so we have 12 files on the tape
23 run job=NightlySave 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 run level=Full job=$JobName yes
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/log1.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 cat <<END_OF_DATA >tmp/bconcmds
69 @output /dev/null
70 messages
71 @$out tmp/log2.out
72 run level=Full job=$JobName yes
73 wait
74 messages
75 quit
76 END_OF_DATA
77 bin/bacula stop 2>&1 >/dev/null
78
79 run_bconsole
80 check_for_zombie_jobs storage=DDS-4
81 stop_bacula
82
83 check_two_logs
84 # no diff made
85 dstat=0
86 end_test
87