]> git.sur5r.net Git - bacula/bacula/commitdiff
Add bscan-tape test
authorKern Sibbald <kern@sibbald.com>
Thu, 22 Apr 2004 12:23:22 +0000 (12:23 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 22 Apr 2004 12:23:22 +0000 (12:23 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1264 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tape-tests
regress/scripts/bacula-dir-tape.conf.in
regress/scripts/test-bacula-dir.conf.in
regress/scripts/testa-bacula-dir.conf.in
regress/tests/bscan-tape [new file with mode: 0755]
regress/tests/four-jobs-tape

index 53b3f2945b3a7d179fbb676abec87864c0f26c80..b10c8babc80d07067d9fcb9d80914104a22227c2 100755 (executable)
@@ -10,6 +10,7 @@ tests/incremental-tape
 tests/four-concurrent-jobs-tape
 tests/four-jobs-tape
 tests/fixed-block-size-tape
+tests/bscan-tape
 echo " "
 echo " "
 echo "Test results"
index 8868a24a4d6e7d75f1f226fd8f09c01f13b595d5..48d89b6eb3c4b1e36d03036b8e9f5eb5487b46ff 100644 (file)
@@ -113,7 +113,7 @@ Messages {
   operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
   MailOnError = @job_email@ = all, !terminate
   operator = @job_email@ = mount
-  console = all, !skipped, !terminate
+  console = all, !skipped, !terminate, !restored
 #
 # WARNING! the following will create a file that you must cycle from
 #          time to time as it will grow indefinitely. However, it will
index 1474f3ef8a7758dd53013dcb4b154cefbed82544..57286c39d6dbbe37a684468a107dfcaf33e289ca 100644 (file)
@@ -266,7 +266,7 @@ Messages {
   operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
   MailOnError = @job_email@ = all
   operator = @job_email@ = mount
-  console = all, !skipped, !terminate
+  console = all, !skipped, !terminate, !restored
 #
 # WARNING! the following will create a file that you must cycle from
 #          time to time as it will grow indefinitely. However, it will
index 6a2aba037215ba31cbc5ae289ee176345ad4aa9f..33701f7cda422e1e1a3e45791e090e6e5252744c 100644 (file)
@@ -121,7 +121,7 @@ Messages {
 Messages {
   Name = NoEmail
   mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  console = all, !skipped, !terminate
+  console = all, !skipped, !terminate, !restored
   append = "@working_dir@/log" = all, !skipped
 }
 
diff --git a/regress/tests/bscan-tape b/regress/tests/bscan-tape
new file mode 100755 (executable)
index 0000000..3fd0b84
--- /dev/null
@@ -0,0 +1,144 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory using the compressed option
+#   then backup four times, each with incremental then 
+#   do a bscan and restore.
+#   It should require at least 4 different bsrs.
+#
+cwd=`pwd`
+bin/bacula stop 2>&1 >/dev/null
+scripts/copy-tape-confs
+scripts/cleanup-tape
+echo "${cwd}/build" >/tmp/file-list
+cd bin
+./drop_bacula_tables >/dev/null 2>&1
+./make_bacula_tables >/dev/null 2>&1
+./grant_bacula_privileges 2>&1 >/dev/null
+cd ..
+cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
+sed "s%# Maximum File Size%  Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
+
+echo " "
+echo " "
+echo " === Starting bscan-tape  ==="
+echo " === Starting bscan-tape  ===" >>working/log
+echo " "
+
+bin/bacula start 2>&1 >/dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+@output /dev/null
+estimate job=NightlySave listing
+estimate job=NightlySave listing
+estimate job=NightlySave listing
+messages
+@output tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=0
+run job=NightlySave yes
+wait
+run job=NightlySave level=Full yes
+wait
+run job=NightlySave level=Full yes
+wait
+messages
+quit
+END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
+echo "Backup 1 done"
+# make some files for the incremental to pick up
+touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
+touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
+   
+#
+# run a second job
+#
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+@output /dev/null
+messages
+@output tmp/log1.out
+run job=NightlySave level=Incremental yes
+wait
+messages
+quit
+END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
+echo "Backup 2 done"
+touch ${cwd}/build/src/dird/*.c
+touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
+#
+# run a third job
+#
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+@output /dev/null
+messages
+@output tmp/log1.out
+run job=NightlySave level=Incremental yes
+wait
+messages
+quit
+END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
+echo "Backup 3 done"
+# make some files for the incremental to pick up
+touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
+#echo "abc" > ${cwd}/build/src/lib/dummy
+#
+# run a fourth job
+#
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+@output /dev/null
+messages
+@output tmp/log1.out
+run job=NightlySave level=Incremental yes
+wait
+messages
+quit
+END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
+echo "Backup 4 done"
+#
+# now drop and recreate the database
+#
+cd bin
+./drop_bacula_tables >/dev/null 2>&1
+./make_bacula_tables >/dev/null 2>&1
+./grant_bacula_privileges 2>&1 >/dev/null
+cd ..
+
+bin/bacula stop 2>&1 >/dev/null
+echo "volume=TestVolume001" >tmp/bscan.bsr
+# bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
+bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf /dev/nst0
+bin/bacula start 2>&1 >/dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
+messages
+@output tmp/log2.out
+@# 
+@# now do a restore
+@#
+restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
+rm -f  ${cwd}/build/src/lib/dummy
+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 -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
+   echo " "
+   echo " "
+   echo "  !!!!! bscan-tape Bacula source failed!!! !!!!! "
+   echo "  !!!!! bscan-tape failed!!! !!!!! " >>test.out
+   echo " "
+else
+   echo "  ===== bscan-tape Bacula source OK ===== "
+   echo "  ===== bscan-tape OK ===== " >>test.out
+#  scripts/cleanup
+fi
index 4b082dbe0e1464586addfc0fe8e40f85f106ee47..71895e9737aae4d1472b4d896a1a7a1a1aee8279 100755 (executable)
@@ -100,11 +100,19 @@ restore where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
 @output tmp/log2.out
+@#
+@# now unmount the tape and start two restores
+@#  at the same time
+@#
+unmount storage=DDS-4
+restore where=${cwd}/tmp/bacula-restores select all done
+yes
 restore where=${cwd}/tmp/bacula-restores select
 unmark *
 mark *
 done
 yes
+mount storage=DDS-4
 wait
 messages
 @output