3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
7 # Run a simple backup of the Bacula build directory
8 # then verify the data on the volume.
10 TestName="verify-data-test"
16 scripts/copy-test-confs
17 echo "${cwd}/tmp/files" >$tmp/file-list
18 echo "${cwd}/build/src/dird" >>$tmp/file-list
19 echo "${cwd}/build/src/filed" >>$tmp/file-list
22 # Add this back when verify can handle sparse files
23 # the same way that backup does
26 dd if=${cwd}/build/configure of=$tmp/files/sparsefile bs=1 count=1 seek=10M > /dev/null
28 change_jobname NightlySave $JobName
31 cat <<END_OF_DATA >tmp/bconcmds
35 label storage=File volume=TestVolume001
36 run job=$JobName level=full fileset=FS1 yes
37 run job=$JobName level=full fileset=FS5 yes
38 run job=$JobName level=full fileset=FSno5 yes
39 run job=$JobName level=full fileset=FS5nocheck yes
43 @# now do a verify volume
45 @$out ${cwd}/tmp/log2.out
46 setdebug level=10 client
47 run job=VerifyData jobid=1 yes
48 run job=VerifyData jobid=2 yes
49 run job=VerifyData jobid=3 yes
50 run job=VerifyData jobid=4 yes
59 check_for_zombie_jobs storage=File
62 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "BlockChecksum", "no", "Device")'
65 if [ x$FORCE_DEDUP = xyes ]; then
67 elif [ x$FORCE_ALIGNED = xyes ]; then
68 sed -i 's/DUALCASE/PUALCASE/g' $tmp/TestVolume001.add
70 sed -i 's/DUALCASE/PUALCASE/g' $tmp/TestVolume001
73 cat <<END_OF_DATA >tmp/bconcmds
76 @# now do a verify volume with errors
78 @$out ${cwd}/tmp/log3.out
79 setdebug level=10 client
80 run job=VerifyData jobid=1 yes
81 run job=VerifyData jobid=2 yes
82 run job=VerifyData jobid=3 yes
83 run job=VerifyData jobid=4 yes
92 check_for_zombie_jobs storage=File
95 nb=`grep "^ Termination: *Backup OK" tmp/log1.out | wc -l`
96 if [ $nb -ne 4 ]; then
99 nb=`grep "^ Termination: *Verify OK" tmp/log2.out | wc -l`
100 if [ $nb -ne 4 ]; then
103 nb=`grep "^ Termination: *Verify OK" tmp/log3.out | wc -l`
104 if [ $nb -ne $nbok ]; then