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.
7 TestName="bsr-read-test"
12 scripts/copy-migration-confs
13 scripts/prepare-disk-changer
15 cp ${cwd}/build/configure ${cwd}/tmp
16 cat ${cwd}/build/configure >> ${cwd}/tmp/configure
17 echo "${cwd}/tmp/configure" >${cwd}/tmp/file-list
18 echo "${cwd}/build" >>${cwd}/tmp/file-list
20 change_jobname NightlySave $JobName
23 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
26 @$out ${cwd}/tmp/log1.out
27 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
28 label storage=File volume=TestVolume001 pool=Default
33 @# print the JobMedia records
35 select * from JobMedia;
41 check_for_zombie_jobs storage=File
44 echo "${cwd}/build" >${cwd}/tmp/file-list
46 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
49 @$out ${cwd}/tmp/log1.out
50 run job=$JobName level=Full yes
53 run job=$JobName level=Full yes
56 run job=$JobName level=Full yes
62 @$out ${cwd}/tmp/log2.out
63 setdebug level=30 trace=1 fd
64 setdebug level=500 trace=1 storage=File
66 @# print the JobMedia records
67 select * from JobMedia;
83 @$out ${cwd}/tmp/log3.out
99 update volume=TestVolume001 volstatus=Used
100 run job=migrate-job jobid=1 yes
101 run job=migrate-job jobid=2 yes
102 run job=migrate-job jobid=3 yes
109 check_for_zombie_jobs storage=File
113 # check_restore_tmp_build_diff
118 return unless ($last_block || $last_bsr_block);
119 $nb = $last_block - $last_bsr_block;
121 print "ERROR: read too many bytes $nb\n";
125 if ($last_bsr_addr) {
126 $last_bsr_block = $last_bsr_addr & 0xFFFFFFFF;
128 print "$last_job\nlast_bsr_block=$last_bsr_block last_block_read=$last_block\n";
130 $last_bsr_block = $last_block=0;
133 if (/dircmd.c.+(JobId=\d+ job=\S+) .+client_name=.+-fd/) {
139 $last_job=$1 if /dircmd.c.+(JobId=\d+ job=\S+)/;
140 $last_bsr_addr=$1 if /fd_cmds.c:.+VolAddr=\d+-(\d+)/;
141 $last_bsr_block=$1 if /fd_cmds.c:.+VolBlock=\d+-(\d+)/;
142 $last_block=$1 if /read_record.c.+file:block=\d+:(\d+)/;
145 }' working/*-sd.trace > tmp/result
147 grep ERROR tmp/result > /dev/null
148 if [ $? -eq 0 ]; then