]> git.sur5r.net Git - bacula/bacula/commitdiff
Add new concurrent tests
authorKern Sibbald <kern@sibbald.com>
Tue, 17 Jun 2003 20:34:42 +0000 (20:34 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 17 Jun 2003 20:34:42 +0000 (20:34 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@588 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/test-bacula-dir.conf.in
regress/tests/concurrent-jobs-test [new file with mode: 0755]

index d210e966d4612eb319e6831ee7a84f8a9b63ef82..e584b9f5d3e4521850c0ae51a9b8a6f41177b367 100644 (file)
@@ -36,6 +36,7 @@ Job {
   Messages = Standard
   Pool = Default
   Write Bootstrap = "@working_dir@/NightlySave.bsr"
+  Maximum Concurrent Jobs = 4
 }
 
 Job {
@@ -215,6 +216,7 @@ Storage {
   Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
   Device = FileStorage1
   Media Type = File1
+  Maximum Concurrent Jobs = 4
 }
 
 
diff --git a/regress/tests/concurrent-jobs-test b/regress/tests/concurrent-jobs-test
new file mode 100755 (executable)
index 0000000..2af285a
--- /dev/null
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# Run two jobs at the same time
+#
+cwd=`pwd`
+scripts/copy-test-confs
+scripts/cleanup
+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 concurrent-jobs-test  ==="
+echo " === Starting concurrent-jobs-test  ===" >>working/log
+echo " "
+
+bin/bacula start 2>&1 >/dev/null
+bin/console -c bin/console.conf <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log1.out
+label storage=File
+TestVolume001
+run job=CompressedTest level=Full
+yes
+run job=CompressedTest level=Full
+yes
+run job=CompressedTest level=Full
+yes
+run job=CompressedTest level=Full
+yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores
+5
+done
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+
+bin/bacula stop 2>&1 >/dev/null
+grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
+bstat=$?
+grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
+rstat=$?
+diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  ===== concurrent-jobs-test Bacula source failed!!! ===== "
+   echo "  ===== concurrent-jobs-test failed!!! ===== " >>test.out
+   echo " "
+else
+   echo "  ===== concurrent-jobs-test Bacula source OK ===== "
+   echo "  ===== concurrent-jobs-test OK ===== " >>test.out
+   scripts/cleanup
+fi