From: Eric Bollengier Date: Thu, 2 Jul 2009 11:38:59 +0000 (+0000) Subject: ebl Add estimate test X-Git-Tag: Release-3.0.2~118 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6f03d2a753a93ae40f7290b6ba00416661b27a4c;p=bacula%2Fbacula ebl Add estimate test git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8948 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/DartTestfile.txt.in b/regress/DartTestfile.txt.in index c3c3f666e9..1069df0c4b 100644 --- a/regress/DartTestfile.txt.in +++ b/regress/DartTestfile.txt.in @@ -20,6 +20,7 @@ ADD_TEST(disk:copy-volume-test "@regressdir@/tests/copy-volume-test") ADD_TEST(disk:data-encrypt-test "@regressdir@/tests/data-encrypt-test") ADD_TEST(disk:differential-test "@regressdir@/tests/differential-test") ADD_TEST(disk:encrypt-bug-test "@regressdir@/tests/encrypt-bug-test") +ADD_TEST(disk:estimate-test "@regressdir@/tests/estimate-test") ADD_TEST(disk:fast-two-pool-test "@regressdir@/tests/fast-two-pool-test") ADD_TEST(disk:fifo-test "@regressdir@/tests/fifo-test") ADD_TEST(disk:fileregexp-test "@regressdir@/tests/fileregexp-test") diff --git a/regress/all-disk-tests b/regress/all-disk-tests index f9b036071b..b5912d76f9 100755 --- a/regress/all-disk-tests +++ b/regress/all-disk-tests @@ -23,6 +23,7 @@ nice tests/copy-upgrade-test nice tests/copy-volume-test nice tests/data-encrypt-test nice tests/encrypt-bug-test +nice tests/estimate-test nice tests/fifo-test nice tests/fileregexp-test nice tests/backup-to-null diff --git a/regress/tests/estimate-test b/regress/tests/estimate-test new file mode 100755 index 0000000000..212a5d4f86 --- /dev/null +++ b/regress/tests/estimate-test @@ -0,0 +1,97 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory +# then restore it. +# +TestName="estimate-test" +. scripts/functions +JobName=BackupClient1 + +scripts/cleanup +scripts/copy-confs + +# +# Zap out any schedule in default conf file so that +# it doesn't start during our test +# +outf="$tmp/sed_tmp" +echo "s% Schedule =%# Schedule =%g" >${outf} +cp $scripts/bacula-dir.conf $tmp/1 +sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf + +start_test + +mkdir ${cwd}/build/src/test +touch ${cwd}/build/src/test/test1 ${cwd}/build/src/test/test2 + +cat <$tmp/bconcmds +@output /dev/null +messages +@$out $tmp/log1.out +label volume=TestVolume001 storage=File pool=Default +run job=$JobName yes +wait +messages +@# +@# now do a restore +@# +@$out $tmp/log2.out +restore where=$tmp/bacula-restores select all done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bacula + +check_two_logs +check_restore_diff + +mv ${cwd}/build/src/test ${cwd}/build/po/test + +cat <$tmp/bconcmds +@output /dev/null +messages +@$out $tmp/log3.out +estimate listing job=$JobName level=incremental +messages +quit +END_OF_DATA + +run_bconsole + +cp $scripts/bacula-dir.conf $tmp/1 +sed 's/JobDefs {/JobDefs { Accurate=yes/' $tmp/1>$scripts/bacula-dir.conf + +cat <$tmp/bconcmds +@output /dev/null +messages +@$out $tmp/log4.out +reload +estimate listing job=$JobName level=incremental +messages +quit +END_OF_DATA + +run_bconsole + +rm -rf ${cwd}/build/po/test + +grep test1 $tmp/log3.out > /dev/null +if [ $? = 0 ]; then + print_debug "Normal estimate shouldn't detect test1 file in $tmp/log3.out" + dstat=2 +fi + +grep test1 $tmp/log4.out > /dev/null +if [ $? != 0 ]; then + print_debug "Accurate estimate should detect test1 file in $tmp/log4.out" + dstat=2 +fi + +check_for_zombie_jobs storage=File + +stop_bacula +end_test