]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/truncate-bug-tape
Fix typo in db_password for bscan 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
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 @#setdebug level=100 dir
26 setdebug level=100 storage=DDS-4
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=DDS-4
46
47 cat <<END_OF_DATA >tmp/bconcmds
48 @output /dev/null
49 messages
50 @$out tmp/log2.out
51 @# 
52 @# now do a restore
53 @#
54 restore where=${cwd}/tmp/bacula-restores storage=DDS-4
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 @output
66 quit
67 END_OF_DATA
68
69 run_bconsole
70 scripts/check_for_zombie_jobs storage=DDS-4
71
72 # Now write to tape one more time
73 cat <<END_OF_DATA >tmp/bconcmds
74 @output /dev/null
75 messages
76 @$out tmp/log3.out
77 run level=Full job=$JobName yes
78 wait
79 messages
80 quit
81 END_OF_DATA
82
83 run_bconsole
84 check_for_zombie_jobs storage=DDS-4
85 stop_bacula
86
87 check_two_logs
88 grep "^  Termination: *Backup OK" tmp/log3.out 2>&1 >/dev/null
89 dstat=$?
90 end_test