]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bsr-read-test
ebl Update bsr-read-test
[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-test-confs
13 cp ${cwd}/build/configure ${cwd}/tmp
14 cat ${cwd}/build/configure >> ${cwd}/tmp/configure
15 echo "${cwd}/tmp/configure" >${cwd}/tmp/file-list
16 echo "${cwd}/build" >>${cwd}/tmp/file-list
17
18
19 change_jobname CompressedTest $JobName
20 start_test
21
22 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
23 @$out /dev/null
24 messages
25 @$out ${cwd}/tmp/log1.out
26 label storage=File volume=TestVolume001
27 label storage=File volume=TestVolume002
28 label storage=File volume=TestVolume003
29 update Volume=TestVolume001 maxvolbytes=120000
30 update Volume=TestVolume002 maxvolbytes=120000
31 run job=$JobName yes
32 wait
33 messages
34 list jobs
35 @# print the JobMedia records
36 sql
37 select * from JobMedia;
38
39 quit
40 END_OF_DATA
41
42 run_bacula
43 check_for_zombie_jobs storage=File
44 stop_bacula
45
46 echo "${cwd}/build" >${cwd}/tmp/file-list
47
48 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
49 @$out /dev/null
50 messages
51 @$out ${cwd}/tmp/log1.out
52 run job=$JobName level=Full yes
53 wait
54 messages
55 run job=$JobName level=Full yes
56 wait
57 messages
58 @# 
59 @# now do a restore
60 @#
61 @$out ${cwd}/tmp/log2.out
62 setdebug level=30 trace=1 fd
63 setdebug level=500 trace=1 storage=File
64 sql
65 @# print the JobMedia records
66 select * from JobMedia;
67
68 restore
69 3
70 1
71 mark *
72 done
73 yes
74 wait
75 messages
76 @# 
77 @# now do a restore of the second job (to compare offset)
78 @#
79 @$out ${cwd}/tmp/log3.out
80 restore
81 3
82 2
83 mark *
84 done
85 yes
86 wait
87 messages
88 @$out
89 quit
90 END_OF_DATA
91
92 run_bacula
93 check_for_zombie_jobs storage=File
94 stop_bacula
95
96 check_two_logs
97 # check_restore_tmp_build_diff
98 dstat=0
99 end_test