]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Add Accurate tests
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 21 Feb 2008 23:48:41 +0000 (23:48 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 21 Feb 2008 23:48:41 +0000 (23:48 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6458 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/bacula-dir.conf.accurate.in [new file with mode: 0644]
regress/scripts/do_sed
regress/tests/accurate-test [new file with mode: 0755]

diff --git a/regress/scripts/bacula-dir.conf.accurate.in b/regress/scripts/bacula-dir.conf.accurate.in
new file mode 100644 (file)
index 0000000..da8fc69
--- /dev/null
@@ -0,0 +1,109 @@
+#
+# Default Bacula Director Configuration file
+#
+#  The only thing that MUST be changed is to add one or more
+#   file or directory names in the Include directive of the
+#   FileSet resource.
+#
+#  For Bacula release 1.39.27 (24 October 2006) -- debian testing/unstable
+#
+#  You might also want to change the default email address
+#   from root to your address.  See the "mail" and "operator"
+#   directives in the Messages resource.
+#
+
+Director {                            # define myself
+  Name = @hostname@-dir
+  DIRPort = @dirport@                # where we listen for UA connections
+  QueryFile = "@scriptdir@/query.sql"
+  WorkingDirectory = "@working_dir@"
+  PidDirectory = "@piddir@"
+  SubSysDirectory = "@subsysdir@"
+  Maximum Concurrent Jobs = 4
+  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
+  Messages = Standard
+}
+
+JobDefs {
+  Name = "DefaultJob"
+  Type = Backup
+  Level = Incremental
+  Client = @hostname@-fd 
+  FileSet = FS_TESTJOB
+  Storage = File
+  Messages = Standard
+  Pool = Default
+  Priority = 10
+  Maximum Concurrent Jobs = 16
+}
+
+FileSet {
+ Name = FS_TESTJOB
+ Include {
+   File=<@tmpdir@/file-list
+ }
+}
+
+Job {
+  Accurate = yes
+  Name = backup
+  JobDefs = DefaultJob
+  FileSet = FS_TESTJOB
+}
+
+# Standard Restore template, to be changed by Console program
+Job {
+  Name = "RestoreFiles"
+  Type = Restore
+  Client=@hostname@-fd
+  FileSet= FS_TESTJOB
+  Storage = File
+  Messages = Standard
+  Pool = Default
+  Where = @tmpdir@/bacula-restores
+}
+
+# Client (File Services) to backup
+Client {
+  Name = @hostname@-fd
+  Address = @hostname@
+  FDPort = @fdport@
+  Catalog = MyCatalog
+  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
+  File Retention = 30d                # 30 days
+  Job Retention = 180d                # six months
+  AutoPrune = yes                     # Prune expired Jobs/Files
+  Maximum Concurrent Jobs = 4
+}
+
+# Definiton of file storage device
+Storage {
+  Name = File
+  Address = @hostname@                # N.B. Use a fully qualified name here
+  SDPort = @sdport@
+  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+  Device = FileStorage
+  Media Type = File
+  Maximum Concurrent Jobs = 4
+}
+
+# Generic catalog service
+Catalog {
+  Name = MyCatalog
+  dbname = regress; user = regress; password = ""
+}
+
+
+Messages {
+  Name = Standard
+  console = all, !skipped, !saved
+}
+
+# Default pool definition
+Pool {
+  Name = Default
+  Pool Type = Backup
+  Recycle = yes                       # Bacula can automatically recycle Volumes
+  AutoPrune = yes                     # Prune expired volumes
+  Volume Retention = 365d             # one year
+}
index ed1e39ad203d344970d83301f37c82ab50605225..8050583f2ecd6bf3047382af6fc2873457977e8e 100755 (executable)
@@ -43,6 +43,7 @@ echo "s%@fdport@%${fdport}%g" >>${out}
 
 # process .in files with sed script
 sed -f ${out} ${cwd}/scripts/bacula-dir.conf.errors.in >${cwd}/scripts/bacula-dir.conf.errors
+sed -f ${out} ${cwd}/scripts/bacula-dir.conf.accurate.in >${cwd}/scripts/bacula-dir.conf.accurate
 sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
 sed -f ${out} ${cwd}/scripts/multi-client-bacula-dir.conf.in >${cwd}/scripts/multi-client-bacula-dir.conf
 sed -f ${out} ${cwd}/scripts/bacula-dir.conf.regexwhere.in >${cwd}/scripts/bacula-dir.conf.regexwhere
diff --git a/regress/tests/accurate-test b/regress/tests/accurate-test
new file mode 100755 (executable)
index 0000000..e34b2b3
--- /dev/null
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# Run a accurate backup of the Bacula build directory
+#   then restore it.
+#
+TestName="accurate-test"
+JobName=backup
+. scripts/functions
+scripts/cleanup
+
+copy_test_confs
+/bin/cp -f scripts/bacula-dir.conf.accurate bin/bacula-dir.conf
+
+rm -rf ${cwd}/build/accurate.new
+rm -rf ${cwd}/build/accurate
+
+change_jobname Client1 $JobName
+mkdir ${cwd}/build/accurate
+echo "test test" > ${cwd}/build/accurate/xxx
+echo "test test" > ${cwd}/build/accurate/yyy
+echo "test test" > ${cwd}/build/accurate/zzz
+echo ${cwd}/build > ${cwd}/tmp/file-list
+
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+label volume=TestVolume001 storage=File pool=Default
+messages
+END_OF_DATA
+
+run_bacula
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out ${cwd}/tmp/log1.out
+run job=$JobName yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out  
+restore 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 second backup after making a few changes
+#
+rm ${cwd}/build/accurate/xxx
+
+run_bconsole
+check_for_zombie_jobs storage=File
+
+check_two_logs
+check_restore_diff
+
+rm -rf ${cwd}/tmp/bacula-restores
+
+# This doesn't work yet...
+#
+## Now do a second backup after making a few changes
+##
+#mv ${cwd}/build/accurate ${cwd}/build/accurate.new
+#
+#run_bconsole
+#check_for_zombie_jobs storage=File
+#
+#check_two_logs
+#check_restore_diff
+#
+#rm -rf ${cwd}/tmp/bacula-restores
+#
+stop_bacula
+end_test