3 # Run a backup of the full bacula build directory, but with the
4 # Maximum File Size set. Then do a restore of a few files to kick in
5 # disk seeking (not yet enabled), and ensure that the restored files
6 # match. Even though disk seeking is not yet enabled, this is a good test,
7 # and once it is enabled, this will test it.
10 if test "$debug" -eq 1 ; then
17 scripts/copy-test-confs
19 echo "${cwd}/tmp/build" >/tmp/file-list
20 rm -rf ${cwd}/tmp/build
21 mkdir ${cwd}/tmp/build
22 # Copy only the .c files (to be restored)
23 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
27 sed s%\^%${cwd}/tmp/build/% 1 >restore-list
28 # At this point restore-list contains the list
29 # of files we will restore
32 # Now backup *everything*
33 rm -rf ${cwd}/tmp/build
34 mkdir ${cwd}/tmp/build
35 cp -fp ${cwd}/build/src/dird/* ${cwd}/tmp/build
36 # Enable MaximumFileSize
37 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
38 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
42 echo " === Starting restore-disk-seek-test at `date +%R:%S` ==="
43 echo " === Starting restore-disk-seek-test at `date +%R:%S` ===" >>working/log
46 cat <<END_OF_DATA >tmp/bconcmds
50 label storage=File volume=TestVolume001
51 run job=CompressedTest yes
59 select * from JobMedia;
61 restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores storage=File
63 <${cwd}/tmp/restore-list
72 if test "$debug" -eq 1 ; then
74 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
76 bin/bacula start 2>&1 >/dev/null
77 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
80 scripts/check_for_zombie_jobs storage=File
81 bin/bacula stop 2>&1 >/dev/null
82 # Now setup a control directory of only what we *should* restore
83 rm -rf ${cwd}/tmp/build
84 mkdir ${cwd}/tmp/build
85 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
86 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
88 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
90 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
91 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
94 echo " !!!!! restore-disk-seek-test Bacula source failed!!! !!!!! "
95 echo " !!!!! restore-disk-seek-test failed!!! !!!!! " >>test.out
96 if [ $bstat != 0 -o $rstat != 0 ] ; then
97 echo " !!!!! Bad Job termination status !!!!! "
98 echo " !!!!! Bad Job termination status !!!!! " >>test.out
100 echo " !!!!! Restored files differ !!!!! "
101 echo " !!!!! Restored files differ !!!!! " >>test.out
105 echo " ===== restore-disk-seek-test Bacula source OK ===== "
106 echo " ===== restore-disk-seek-test OK ===== " >>test.out
108 # rm -rf ${cwd}/tmp/build