]> git.sur5r.net Git - bacula/bacula/commitdiff
Add six-vol-test
authorKern Sibbald <kern@sibbald.com>
Sun, 25 May 2003 13:27:08 +0000 (13:27 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 25 May 2003 13:27:08 +0000 (13:27 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@537 91ce42f0-d328-0410-95d8-f526ca767f89

regress/README
regress/all-non-root-tests
regress/scripts/.cvsignore
regress/scripts/copy-testa-confs [new file with mode: 0755]
regress/scripts/do_sed
regress/scripts/testa-bacula-dir.conf.in [new file with mode: 0644]
regress/tests/six-vol-test [new file with mode: 0755]
regress/tests/test0

index fb6547d1561cefcc67a5c44d392a242eada64cbd..ad5056c4e2cb21ff09e59a0f941ba49bf9663ce1 100644 (file)
@@ -71,3 +71,15 @@ to do:
 
 this cleans up any files that may be created with root permissions.
 
+If you want to add more tests, do so by putting the shell script 
+in the tests subdirectory. Be careful when adding (or better not)
+new clients, pools, and such to the test-bacula-dir.conf.in file
+as it may invalidate a good number of tests, which respond to
+questions by answering with a number (i.e. the order of the selection
+list is known). It might be better to add your own testb-bacula...
+configuration file.  
+
+To avoid re-doing a make setup if you have made a change to the
+conf files, and you do not need a new copy of the source, you can simply do:
+
+   scripts/do-sed <your-email-address>
index 21b32098c455264fed093b82c48d3c79f4b8eab2..4a5ae26998a0687f1b552c4f957bd0f95df6a378 100755 (executable)
@@ -11,6 +11,7 @@ tests/sparse-compressed-test
 tests/wierd-files-test
 tests/two-jobs-test
 tests/two-vol-test
+tests/six-vol-test
 echo " "
 echo " "
 echo "Test results"
index 8e10c7932350de58c09ed652476b46bf3c824b48..61a0e7ea65efc7ff6cbe154745e26acb6955e560 100644 (file)
@@ -6,3 +6,4 @@ test-bacula-dir.conf
 test-bacula-fd.conf
 test-bacula-sd.conf
 test-console.conf
+testa-bacula-dir.conf
diff --git a/regress/scripts/copy-testa-confs b/regress/scripts/copy-testa-confs
new file mode 100755 (executable)
index 0000000..0574b9a
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+/bin/cp -f scripts/testa-bacula-dir.conf bin/bacula-dir.conf
+/bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
+/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
+/bin/cp -f scripts/test-console.conf bin/console.conf
index 2fba967bef2aeec8db4c8ccad0da44d6e89aa157..69bd330c09f2e7ae85bc5d016e9f3ff0ac86db55 100755 (executable)
@@ -12,6 +12,7 @@ echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
 
 # process .in files with sed script
 sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
+sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf
 sed -f ${out} ${cwd}/scripts/test-bacula-fd.conf.in >${cwd}/scripts/test-bacula-fd.conf
 sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-sd.conf
 sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf
diff --git a/regress/scripts/testa-bacula-dir.conf.in b/regress/scripts/testa-bacula-dir.conf.in
new file mode 100644 (file)
index 0000000..554f71b
--- /dev/null
@@ -0,0 +1,150 @@
+#
+# TestA   Bacula Director Configuration file
+#
+#  For Bacula release 1.30 (12 April 2003) -- redhat 7.3
+#
+
+Director {                            # define myself
+  Name = rufus-dir
+  DIRport = 8101                # where we listen for UA connections
+  QueryFile = "@scriptdir@/query.sql"
+  WorkingDirectory = "@working_dir@"
+  PidDirectory = "@piddir@"
+  SubSysDirectory = "@subsysdir@"
+  Maximum Concurrent Jobs = 1
+  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
+  Messages = Standard
+}
+
+
+Job {
+  Name = "MultiVol"
+  Type = Backup
+  Client=rufus-fd 
+  Level = Full
+  FileSet="Full Set"
+  Storage = File 
+  Messages = Standard
+  Write Bootstrap = "@working_dir@/SmallVols.bsr"
+  Pool = SmallVols
+}
+
+
+Job {
+  Name = "VerifyVolume"
+  Type = Verify
+  Level = VolumeToCatalog
+  Client=rufus-fd 
+  FileSet="Full Set"
+  Storage = File
+  Messages = Standard
+  Pool = Default
+  Write Bootstrap = "@working_dir@/NightlySave.bsr"
+}
+
+
+
+# Standard Restore template, to be changed by Console program
+Job {
+  Name = "RestoreFiles"
+  Type = Restore
+  Client=rufus-fd 
+  FileSet="Full Set"
+  Storage = File
+  Messages = Standard
+  Pool = Default
+  Where = /tmp/bacula-restores
+}
+
+
+# List of files to be backed up
+FileSet {
+  Name = "Full Set"
+  Include = signature=SHA1 { 
+    </tmp/file-list
+  }
+}
+
+
+# Client (File Services) to backup
+Client {
+  Name = rufus-fd
+  Address = rufus
+  FDPort = 8102
+  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
+}
+
+# Definiton of file storage device
+Storage {
+  Name = File
+  Address = rufus                # N.B. Use a fully qualified name here
+  SDPort = 8103
+  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+  Device = FileStorage
+  Media Type = File
+}
+
+Storage {
+  Name = File1
+  Address = rufus                # N.B. Use a fully qualified name here
+  SDPort = 8103
+  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+  Device = FileStorage1
+  Media Type = File1
+}
+
+
+# Generic catalog service
+Catalog {
+  Name = MyCatalog
+  dbname = bacula; user = bacula; password = ""
+}
+
+# Reasonable message delivery -- send most everything to email address
+#  and to the console
+Messages {
+  Name = Standard
+  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
+  operatorcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
+  MailOnError = @job_email@ = all
+  operator = @job_email@ = mount
+  console = all, !skipped
+
+  append = "@working_dir@/log" = all, !skipped
+}
+
+Messages {
+  Name = NoEmail
+  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
+  console = all, !skipped
+
+  append = "@working_dir@/log" = all, !skipped
+}
+
+    
+# 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
+  Accept Any Volume = yes             # write on any volume in the pool
+}
+
+Pool {
+  Name = SmallVols
+  Pool Type = Backup
+  Recycle = yes                       # Bacula can automatically recycle Volumes
+  AutoPrune = yes                     # Prune expired volumes
+  Volume Retention = 365d             # one year
+  Accept Any Volume = yes             # write on any volume in the pool
+  Maximum Volumes = 10
+  MaximumVolumeBytes = 10M
+  LabelFormat = Small
+}
+
diff --git a/regress/tests/six-vol-test b/regress/tests/six-vol-test
new file mode 100755 (executable)
index 0000000..1c369e0
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# Create a 60MB file with random bytes. Back it up to 6 Volumes
+#   each constrained to 10MB using the automatic labeling feature.
+#
+cwd=`pwd`
+scripts/copy-testa-confs
+rm -rf tmp/SmallVols* tmp/bacula-restores tmp/largefile
+echo "${cwd}/tmp/largefile" >/tmp/file-list
+# Create 56MB file with random data
+echo "Creating a 56MB file with random data ..."
+dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000
+echo "largefile created"
+bin/bacula stop 2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+echo " "
+echo " "
+echo " === Starting two-vol-test  ==="
+echo " "
+
+bin/bacula start
+bin/console -c bin/console.conf <<END_OF_DATA
+messages
+@output
+run job=MultiVol storage=File
+yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+restore where=${cwd}/tmp/bacula-restores
+5
+done
+yes
+wait
+messages
+quit
+END_OF_DATA
+bin/bacula stop
+diff -ur tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile
+if [ $? != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  ===== six-vol-test Bacula source failed!!! ===== "
+   echo "  ===== six-vol-test failed!!! ===== " >>test.out
+   echo " "
+else
+   echo "  ===== six-vol-test Bacula source OK ===== "
+   echo "  ===== six-vol-test OK ===== " >>test.out
+   rm -rf tmp/bacula-restores tmp/SmallVols* tmp/largefile
+fi
index 8a6da1bf99b27e225fe293754a6d85a6e108533f..0d0edd0b8509584b0088a8a342e2d5b0dea1d403 100755 (executable)
@@ -1,2 +1,3 @@
 #!/bin/sh
 echo " " >test.out
+rm -f bin/working/*