]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Add an other test for Copy feature
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 17 Oct 2008 11:48:39 +0000 (11:48 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 17 Oct 2008 11:48:39 +0000 (11:48 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7828 91ce42f0-d328-0410-95d8-f526ca767f89

regress/tests/copy-jobspan-test [new file with mode: 0755]
regress/tests/copy-volume-test

diff --git a/regress/tests/copy-jobspan-test b/regress/tests/copy-jobspan-test
new file mode 100755 (executable)
index 0000000..78025fd
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory then migrate it
+#   to another device.
+#
+# Test copy a job that spans two Volumes
+#
+# This script uses the virtual disk autochanger
+#
+TestName="copy-jobspan-test"
+JobName=CopyJobSpanSave
+. scripts/functions
+
+
+scripts/cleanup
+scripts/copy-migration-confs
+scripts/prepare-disk-changer
+echo "${cwd}/build" >${cwd}/tmp/file-list
+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
+sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
+sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
+
+change_jobname NightlySave $JobName
+start_test
+
+#
+# Note, we first backup into Pool Default, 
+#          then Copy into Pool Full. 
+#              Pool Default uses Storage=File
+#              Pool Full    uses Storage=DiskChanger
+
+# Write out bconsole commands
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output
+messages
+@$out ${cwd}/tmp/log1.out
+@#setdebug level=10 dir
+@#setdebug level=100 storage=File
+label storage=File volume=FileVolume001 Pool=Default
+label storage=File volume=FileVolume002 Pool=Default
+update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
+label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
+label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
+list volumes
+@#
+run job=$JobName yes
+@#run job=$JobName yes
+wait
+list volumes
+@#setdebug level=200 dir
+@# should migrate both Volumes
+run job=copy-job yes
+wait
+purge volume=FileVolume001
+purge volume=FileVolume002
+list volumes
+list jobs
+messages
+wait
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test
index dee1f8fdb13c1aaf8423008f83c6f72da02c545e..f018d8e5c4d9b66182459086994036d6381c7e0f 100755 (executable)
@@ -18,8 +18,8 @@ echo "${cwd}/build" >${cwd}/tmp/file-list
 #sed "s%# Maximum File Size%  Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
 
 change_jobname NightlySave $JobName
-sed -i 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf
-sed -i 's/Migrate/Copy/g' ${cwd}/bin/bacula-dir.conf
+sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
+sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
 rm -f ${cwd}/build/po/test.po >/dev/null
 
 start_test