]> git.sur5r.net Git - bacula/bacula/commitdiff
Add swap test
authorKern Sibbald <kern@sibbald.com>
Fri, 4 Apr 2008 06:31:17 +0000 (06:31 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 4 Apr 2008 06:31:17 +0000 (06:31 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6738 91ce42f0-d328-0410-95d8-f526ca767f89

regress/DartTestfile.txt.in
regress/tests/2drive-2job-test [new file with mode: 0755]

index 078bf717de8fb5ac755dd9c5f3f95aa93b628256..6999985180e259f0257dfe2ed03eceda9b9269b9 100644 (file)
@@ -43,6 +43,7 @@ ADD_TEST(disk:sparse-test "@regressdir@/tests/sparse-test")
 ADD_TEST(disk:2drive-3pool-test "@regressdir@/tests/2drive-3pool-test")
 ADD_TEST(disk:2drive-concurrent-test "@regressdir@/tests/2drive-concurrent-test")
 ADD_TEST(disk:2drive-incremental-2disk "@regressdir@/tests/2drive-incremental-2disk")
+ADD_TEST(disk:2drive-2job-test "@regressdir@/tests/2drive-2job-test")
 ADD_TEST(disk:three-pool-test "@regressdir@/tests/three-pool-test")
 ADD_TEST(disk:tls-test "@regressdir@/tests/tls-test")
 ADD_TEST(disk:two-jobs-test "@regressdir@/tests/two-jobs-test")
diff --git a/regress/tests/2drive-2job-test b/regress/tests/2drive-2job-test
new file mode 100755 (executable)
index 0000000..0b4e068
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Set prefer mounted volumes to no to try to force use of
+#   the drive swap code.
+#
+# This script uses the virtual disk autochanger and two drives
+#
+TestName="2drive-2job"
+JobName="2drive2job"
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-2disk-drive-confs
+scripts/prepare-two-disks
+
+change_jobname NightlySave $JobName
+start_test
+
+echo "${cwd}/build" >${cwd}/tmp/file-list
+
+# Turn off Prefer Mounted Volumes so we use 2 drives
+outf="${cwd}/tmp/sed_tmp"
+echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
+cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
+# Comment the next line out to write everything to one drive
+#  otherwise, it writes the two jobs to different drives
+sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
+
+# Write out bconsole commands
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=2 Pool=Default drive=0
+label storage=DDS-4 volume=TestVolume002 slot=1 Pool=Default drive=1
+status storage=DDS-4
+@#unmount storage=DDS-4 drive=0
+@#unmount storage=DDS-4 drive=1
+@#mount storage=DDS-4 slot=2 drive=0
+@#mount storage=DDS-4 slot=1 drive=1
+status storage=DDS-4
+setdebug level=120 storage=DDS-4
+run job=$JobName level=Full yes
+@sleep 2
+run job=$JobName level=Full yes
+status storage=DDS-4
+wait
+list volumes
+list jobs
+status storage=DDS-4
+messages
+quit
+END_OF_DATA
+
+run_bacula
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
+messages
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+@#unmount storage=DDS-4 drive=0
+@#unmount storage=DDS-4 drive=1
+@#mount storage=DDS-4 slot=1 drive=0
+@#mount storage=DDS-4 slot=2 drive=1
+restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+run_bconsole
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+check_two_logs
+check_restore_diff
+
+end_test