]> git.sur5r.net Git - bacula/bacula/commitdiff
Add bsr optimize test
authorKern Sibbald <kern@sibbald.com>
Sun, 6 Jul 2003 15:10:12 +0000 (15:10 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 6 Jul 2003 15:10:12 +0000 (15:10 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@621 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tests
regress/tests/bsr-opt-test [new file with mode: 0755]

index b49630dc9f1fe1bb3403a4a4e41127af7d84c350..69d5c68c32685a7975c7e85e2bf9b33d0cbe6df5 100755 (executable)
@@ -16,6 +16,7 @@ tests/bscan-test
 tests/wierd-files2-test
 tests/concurrent-jobs-test
 tests/concurrent2-jobs-test
+tests/bsr-opt-test
 echo " "
 echo " "
 echo "Test results"
diff --git a/regress/tests/bsr-opt-test b/regress/tests/bsr-opt-test
new file mode 100755 (executable)
index 0000000..c366cfe
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory but 
+#   split the archive into two volumes, then restore
+#   files on only one of the volumes and ensure that
+#   the other volume is not used.
+#
+cwd=`pwd`
+scripts/copy-test-confs
+scripts/cleanup
+echo "${cwd}/build" >/tmp/file-list
+bin/bacula stop 2>&1 >/dev/null
+bin/drop_sqlite_tables
+bin/make_sqlite_tables
+
+echo " "
+echo " "
+echo " === Starting bsr-opt-test  ==="
+echo " === Starting bsr-opt-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=File1
+TestVolume001
+label storage=File1
+TestVolume002
+update Volume=TestVolume001
+6
+3000000
+10
+run job=NightlySave storage=File1
+yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores current
+unmark *
+cd ${cwd}/build/src/cats
+mark *
+ls
+done
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+bin/bacula stop 2>&1 >/dev/null
+grep TestVolume001 working/restore.bsr
+bsrstat=$?
+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 -r build/src/cats  tmp/bacula-restores${cwd}/build/src/cats
+if [ $? != 0 -o $bsrstat != 1 -o $bstat != 0 -o $rstat != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  !!!!! bsr-opt-test Bacula source failed!!! !!!!! "
+   echo "  !!!!! bsr-opt-test failed!!! !!!!! " >>test.out
+   echo " "
+else
+   echo "  ===== bsr-opt-test Bacula source OK ===== "
+   echo "  ===== bsr-opt-test OK ===== " >>test.out
+   scripts/cleanup
+fi