3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a backup of the full bacula build directory, but with the
9 # Maximum File Size set. Then do a restore of a few files to kick in
10 # disk seeking (not yet enabled), and ensure that the restored files
11 # match. Even though disk seeking is not yet enabled, this is a good test,
12 # and once it is enabled, this will test it.
14 TestName="restore-disk-seek-test"
15 JobName=restore-disk-seek
19 scripts/copy-test-confs
20 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
21 rm -rf ${cwd}/tmp/build
22 mkdir -p ${cwd}/tmp/build
23 # Copy only the .c files (to be restored)
24 # set files to "*.c" for all c files
25 files="ua_tree.c ua_update.c"
28 cp -p ${cwd}/build/src/dird/${i} ${cwd}/tmp/build
33 sed s%\^%${cwd}/tmp/build/% 1 | sort | uniq >restore-list
35 # At this point restore-list contains the list
36 # of files we will restore
41 # Now arrange to backup *everything*
43 rm -rf ${cwd}/tmp/build
44 mkdir -p ${cwd}/tmp/build
45 cp -fp ${cwd}/build/src/dird/* ${cwd}/tmp/build
47 # Enable MaximumFileSize to ensure lots of JobMedia records and thus
50 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
51 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
53 change_jobname CompressedTest $JobName
56 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
59 @$out ${cwd}/tmp/log1.out
60 label storage=File volume=TestVolume001
67 @$out ${cwd}/tmp/log2.out
69 setdebug level=11 storage=File
71 @# print the JobMedia records
72 select * from JobMedia;
74 restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores storage=File
76 <${cwd}/tmp/restore-list
85 check_for_zombie_jobs storage=File
88 # Now setup a control directory of only what we *should* restore
89 rm -rf ${cwd}/tmp/build
90 mkdir -p ${cwd}/tmp/build
92 cp -p ${cwd}/build/src/dird/${i} ${cwd}/tmp/build
96 check_restore_tmp_build_diff