]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bsr-read-test
8c18e022dbf31189e699bce3074988d570dc8a75
[bacula/bacula] / regress / tests / bsr-read-test
1 #!/bin/sh
2 #
3 # Run a backup of a small file, then do several other backups
4 #   to expand the size of a volume.  Then do a restore of the first
5 #   file, and make sure it doesn't read to the end of the disk.
6 #
7 TestName="bsr-read-test"
8 JobName=bsr-read
9 . scripts/functions
10
11 scripts/cleanup
12 scripts/copy-migration-confs
13 scripts/prepare-disk-changer
14 cp ${cwd}/build/configure ${cwd}/tmp
15 cat ${cwd}/build/configure >> ${cwd}/tmp/configure
16 echo "${cwd}/tmp/configure" >${cwd}/tmp/file-list
17 echo "${cwd}/build" >>${cwd}/tmp/file-list
18
19
20 change_jobname NightlySave $JobName
21 start_test
22
23 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
24 @$out /dev/null
25 messages
26 @$out ${cwd}/tmp/log1.out
27 label storage=File volume=TestVolume001 pool=Default
28 label storage=File volume=TestVolume002 pool=Default
29 label storage=File volume=TestVolume003 pool=Default
30 update Volume=TestVolume001 maxvolbytes=120000
31 update Volume=TestVolume002 maxvolbytes=120000
32 run job=$JobName yes
33 wait
34 messages
35 list jobs
36 @# print the JobMedia records
37 sql
38 select * from JobMedia;
39
40 quit
41 END_OF_DATA
42
43 run_bacula
44 check_for_zombie_jobs storage=File
45 stop_bacula
46
47 echo "${cwd}/build" >${cwd}/tmp/file-list
48
49 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
50 @$out /dev/null
51 messages
52 @$out ${cwd}/tmp/log1.out
53 run job=$JobName level=Full yes
54 wait
55 messages
56 run job=$JobName level=Full yes
57 wait
58 messages
59 @# 
60 @# now do a restore
61 @#
62 @$out ${cwd}/tmp/log2.out
63 setdebug level=30 trace=1 fd
64 setdebug level=500 trace=1 storage=File
65 sql
66 @# print the JobMedia records
67 select * from JobMedia;
68
69 restore
70 3
71 1
72 mark *
73 done
74 yes
75 wait
76 messages
77 @# 
78 @# now do a restore of the second job (to compare offset)
79 @#
80 @$out ${cwd}/tmp/log3.out
81 restore
82 3
83 2
84 mark *
85 done
86 yes
87 wait
88 messages
89 @$out
90 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
91 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
92 update volume=TestVolume003 volstatus=Used
93 run job=migrate-job jobid=1 yes
94 run job=migrate-job jobid=2 yes
95 wait
96 messages
97 quit
98 END_OF_DATA
99
100 run_bacula
101 check_for_zombie_jobs storage=File
102 stop_bacula
103
104 check_two_logs
105 # check_restore_tmp_build_diff
106 dstat=0
107 end_test