]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/truncate-bug-tape
Fix tape tests
[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 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 wait
35 messages
36 quit
37 END_OF_DATA
38
39 run_bacula
40 scripts/check_for_zombie_jobs storage=DDS-4
41
42 cat <<END_OF_DATA >tmp/bconcmds
43 @output /dev/null
44 messages
45 @$out tmp/log2.out
46 @# 
47 @# now do a restore
48 @#
49 restore where=${cwd}/tmp/bacula-restores storage=DDS-4
50 3
51 @# select JobId=4 (i.e. file five on the tape)
52 4
53 cd ${cwd}/build
54 @# mark a single file
55 mark configure
56 done
57 yes
58 wait
59 messages
60 @output
61 quit
62 END_OF_DATA
63
64 run_bconsole
65 scripts/check_for_zombie_jobs storage=DDS-4
66
67 # Now write to tape one more time
68 cat <<END_OF_DATA >tmp/bconcmds
69 @output /dev/null
70 messages
71 @$out tmp/log3.out
72 run level=Full job=$JobName yes
73 wait
74 messages
75 quit
76 END_OF_DATA
77
78 run_bconsole
79 check_for_zombie_jobs storage=DDS-4
80 stop_bacula
81
82 check_two_logs
83 grep "^  Termination: *Backup OK" tmp/log3.out 2>&1 >/dev/null
84 dstat=$?
85 end_test