]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/truncate-bug-tape
regress: tweak the message in the update_win32()
[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 @$out /dev/null
21 messages
22 @$out   tmp/log1.out
23 label storage=tape volume=TestVolume001 slot=0 pool=Default
24 @# do a bunch of saves so we have 12 files on the tape
25 @#setdebug level=100 dir
26 setdebug level=100 storage=tape
27 run 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 run level=Full job=$JobName yes
38 run level=Full job=$JobName yes
39 wait
40 messages
41 quit
42 END_OF_DATA
43
44 run_bacula
45 scripts/check_for_zombie_jobs storage=tape
46
47 cat <<END_OF_DATA >tmp/bconcmds
48 @$out /dev/null
49 messages
50 @$out tmp/log2.out
51 @# 
52 @# now do a restore
53 @#
54 restore where=${cwd}/tmp/bacula-restores storage=tape
55 3
56 @# select JobId=4 (i.e. file five on the tape)
57 4
58 cd ${cwd}/build
59 @# mark a single file
60 mark configure
61 done
62 yes
63 wait
64 messages
65 quit
66 END_OF_DATA
67
68 run_bconsole
69 scripts/check_for_zombie_jobs storage=tape
70
71 # Now write to tape one more time
72 cat <<END_OF_DATA >tmp/bconcmds
73 @$out /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=tape
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