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