]> git.sur5r.net Git - bacula/bacula/commitdiff
Create fifo backup/restore test
authorKern Sibbald <kern@sibbald.com>
Wed, 28 Feb 2007 17:47:43 +0000 (17:47 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 28 Feb 2007 17:47:43 +0000 (17:47 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4283 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tests
regress/scripts/cleanup
regress/scripts/new-test-bacula-dir.conf.in
regress/tests/fifo-test [new file with mode: 0755]

index e93a5a5d435b3d9b2450ef8e1608d40c2a88e139..60e233ca334059acff2c768d70988e6739e574cf 100755 (executable)
@@ -15,6 +15,7 @@ tests/compress-encrypt-test
 tests/concurrent-jobs-test
 tests/data-encrypt-test
 tests/encrypt-bug-test
+tests/fifo-test
 tests/backup-bacula-fifo
 # The following two can uses *lots* of disk space
 #   so they are normally turned off, but if you have
index 46079e4f1f7cdcfd2df9640d7b77a130770108d3..d1eaea50402b17d87fffeedd70e485f544691af9 100755 (executable)
@@ -8,7 +8,7 @@ rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
 rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
 rm -rf /tmp/sed_tmp /tmp/file-list
 rm -rf tmp/build tmp/restore-list tmp/restore2-list
-rm -rf tmp/fd.out tmp/dir.out tmp/sd.out
+rm -rf tmp/fd.out tmp/dir.out tmp/sd.out tmp/*.jpg
 rm -rf working/log tmp/TEST-*
 rm -rf working/*.bsr
 rm -rf tmp/disk-changer /tmp/disk-changer
index f190724fc35bd726ae8728a8551db4d254a3e15a..5114c2dc4023fb2c6f50c53c04aa4b39659aca3e 100644 (file)
@@ -99,6 +99,18 @@ Job {
   Write Bootstrap = "@working_dir@/NightlySave.bsr"
 }
 
+Job {
+  Name = "FIFOTest"
+  Type = Backup
+  Client=@hostname@-fd 
+  FileSet="FIFOSet"
+  Storage = File
+  Messages = Standard
+  Pool = Default
+  Write Bootstrap = "@working_dir@/NightlySave.bsr"
+}
+
+
 
 # Backup the catalog database (after the nightly save)
 Job {
@@ -187,6 +199,18 @@ FileSet {
   }
 }
 
+FileSet {
+  Name = "FIFOSet"
+  Include {
+    Options {
+      readfifo = yes
+      signature=MD5 
+    }
+    File = </tmp/file-list
+  }
+}
+
+
 FileSet {
   Name = "SparseCompressedSet"
   Include {
diff --git a/regress/tests/fifo-test b/regress/tests/fifo-test
new file mode 100755 (executable)
index 0000000..8ff28b8
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# Attempt to backup from a fifo and restore to a fifo
+#
+TestName="fifo-test"
+JobName=FIFOTest
+. scripts/functions
+set_debug 0
+
+cwd=`pwd`
+scripts/cleanup
+scripts/copy-test-confs
+echo "/tmp/bfifo" >/tmp/file-list
+
+rm -f /tmp/bfifo
+# send a file into the fifo
+file=encrypt-bug.jpg
+cat ${file} >/tmp/bfifo&
+
+start_test
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@$out tmp/log1.out
+label storage=File1 volume=TestVolume001
+run job=$JobName storage=File1 yes
+wait
+messages
+quit
+END_OF_DATA
+
+
+run_bacula
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@# 
+@# now do a restore
+@#
+@$out tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all storage=File1 done
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+cat </tmp/bfifo >tmp/${file} &
+
+run_bconsole
+
+check_for_zombie_jobs storage=File1
+stop_bacula
+
+check_two_logs
+diff ${file} tmp/${file}
+dstat=$?
+end_test