3 # Run a simple backup of the Bacula build directory
6 TestName="estimate-test"
14 # Zap out any schedule in default conf file so that
15 # it doesn't start during our test
18 echo "s% Schedule =%# Schedule =%g" >${outf}
19 cp $scripts/bacula-dir.conf $tmp/1
20 sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf
24 rm -rf ${cwd}/build/src/test ${cwd}/build/po/test
25 mkdir -p ${cwd}/build/src/test
26 touch ${cwd}/build/src/test/test1 ${cwd}/build/src/test/test2
28 cat <<END_OF_DATA >$tmp/bconcmds
32 label volume=TestVolume001 storage=File pool=File
40 restore where=$tmp/bacula-restores select all done
52 mv ${cwd}/build/src/test ${cwd}/build/po/test
54 cat <<END_OF_DATA >$tmp/bconcmds
58 estimate listing job=$JobName level=incremental
65 cat <<END_OF_DATA >$tmp/bconcmds
69 estimate listing job=$JobName level=incremental accurate=yes
76 cp $scripts/bacula-dir.conf $tmp/1
77 sed 's/JobDefs {/JobDefs { Accurate=yes/' $tmp/1>$scripts/bacula-dir.conf
79 cat <<END_OF_DATA >$tmp/bconcmds
84 estimate listing job=$JobName level=incremental
91 cat <<END_OF_DATA >$tmp/bconcmds
95 estimate listing job=$JobName level=incremental accurate=no
102 rm -rf ${cwd}/build/po/test
104 grep test1 $tmp/log3.out > /dev/null
106 print_debug "ERROR: Normal estimate shouldn't detect test1 file in $tmp/log3.out"
110 grep test1 $tmp/log4.out > /dev/null
112 print_debug "ERROR: Accurate=yes estimate should detect test1 file in $tmp/log4.out"
116 grep test1 $tmp/log5.out > /dev/null
118 print_debug "ERROR: Accurate estimate should detect test1 file in $tmp/log5.out"
122 grep test1 $tmp/log6.out > /dev/null
124 print_debug "ERROR: Accurate=no estimate shouldn't detect test1 file in $tmp/log6.out"
128 check_for_zombie_jobs storage=File