From: Eric Bollengier Date: Fri, 22 Feb 2008 20:33:36 +0000 (+0000) Subject: ebl Update accurate tests X-Git-Tag: Release-7.0.0~4975 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=281b5a1d3efe273e38359726f1f160624111514d;p=bacula%2Fbacula ebl Update accurate tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6466 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/bacula-dir.conf.accurate.in b/regress/scripts/bacula-dir.conf.accurate.in index 708971f665..847ee4a7c3 100644 --- a/regress/scripts/bacula-dir.conf.accurate.in +++ b/regress/scripts/bacula-dir.conf.accurate.in @@ -47,6 +47,16 @@ FileSet { } } +FileSet { + Name = FS_TESTJOB_ADVANCE + Include { + Options { + Verify = mcpgu + } + File=<@tmpdir@/file-list + } +} + Job { Accurate = yes Name = backup @@ -54,6 +64,14 @@ Job { FileSet = FS_TESTJOB } +Job { + Accurate = yes + Name = backup_advance + JobDefs = DefaultJob + FileSet = FS_TESTJOB_ADVANCE +} + + # Standard Restore template, to be changed by Console program Job { Name = "RestoreFiles" @@ -99,7 +117,7 @@ Catalog { Messages { Name = Standard - console = all, !skipped, !saved + console = all, !skipped, saved } # Default pool definition diff --git a/regress/tests/accurate-test b/regress/tests/accurate-test index 713faecf71..986cf5e427 100755 --- a/regress/tests/accurate-test +++ b/regress/tests/accurate-test @@ -10,11 +10,16 @@ scripts/cleanup copy_test_confs /bin/cp -f scripts/bacula-dir.conf.accurate bin/bacula-dir.conf +sed -i s/all,/all,saved,/ bin/bacula-fd.conf +change_jobname Client1 $JobName + +# cleanup rm -rf ${cwd}/build/accurate.new rm -rf ${cwd}/build/accurate -change_jobname Client1 $JobName + +# add extra files mkdir ${cwd}/build/accurate echo "test test" > ${cwd}/build/accurate/xxx echo "test test" > ${cwd}/build/accurate/yyy @@ -41,7 +46,7 @@ messages @# now do a restore @# @$out ${cwd}/tmp/log2.out -restore where=${cwd}/tmp/bacula-restores select all done +restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done yes wait messages @@ -49,6 +54,10 @@ messages quit END_OF_DATA +################################################################ +# First : We just run full and restore to compare if all is ok +################################################################ + run_bconsole check_for_zombie_jobs storage=File @@ -57,9 +66,10 @@ check_restore_diff rm -rf ${cwd}/tmp/bacula-restores +################################################################ # Now do a second backup after making a few changes -# -rm ${cwd}/build/accurate/xxx +################################################################ +rm ${cwd}/build/accurate/xxx # delete a file run_bconsole check_for_zombie_jobs storage=File @@ -69,8 +79,11 @@ check_restore_diff rm -rf ${cwd}/tmp/bacula-restores -# Now do a second backup after making a few changes -# +################################################################ +# Now do a third backup after making a few changes +################################################################ + +# some files will have disappear, others have their old mtime/ctime mv ${cwd}/build/accurate ${cwd}/build/accurate.new run_bconsole @@ -81,5 +94,133 @@ check_restore_diff rm -rf ${cwd}/tmp/bacula-restores +################################################################ +# Now do an other test in differential mode +################################################################ + +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log1.out +run job=$JobName level=differential yes +wait +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bconsole +check_for_zombie_jobs storage=File + +check_two_logs +check_restore_diff + +rm -rf ${cwd}/tmp/bacula-restores + +################################################################ +# Now do an other test in differential mode + incremental +################################################################ + +# make some changes +mv ${cwd}/build/accurate.new ${cwd}/build/accurate + +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log1.out +run job=$JobName yes +wait +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bconsole +check_for_zombie_jobs storage=File + +check_two_logs +check_restore_diff + +rm -rf ${cwd}/tmp/bacula-restores + + +################################################################ +# Now do a test with other attributes (owner, gid, rights) +################################################################ + +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log1.out +run job=backup_advance yes +wait +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bconsole +check_for_zombie_jobs storage=File + +check_two_logs +check_restore_diff + +rm -rf ${cwd}/tmp/bacula-restores + + +################################################################ +# Use the p option for verify +################################################################ + +chmod 400 ${cwd}/build/accurate/yyy + +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log1.out +run job=backup_advance yes +wait +messages +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bconsole +check_for_zombie_jobs storage=File + +check_two_logs +check_restore_diff + +rm -rf ${cwd}/tmp/bacula-restores + +if ! grep 'st_mode differ' tmp/log1.out > /dev/null +then + bstat=2 +fi + stop_bacula end_test