]> git.sur5r.net Git - bacula/bacula/commitdiff
Implement migrate volume test
authorKern Sibbald <kern@sibbald.com>
Sat, 8 Jul 2006 06:46:18 +0000 (06:46 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 8 Jul 2006 06:46:18 +0000 (06:46 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3127 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/bacula-dir-migration.conf.in
regress/tests/fixed-block-size-tape
regress/tests/migration-job-test
regress/tests/migration-volume-test [new file with mode: 0755]

index 088ad3e8dc8293c9608fcab9351601eb5ed15bd7..f14cf8a22696fb8f74a2dcfda6697e045c7330d8 100644 (file)
@@ -48,13 +48,29 @@ Job {
   FileSet="Full Set"
   Messages = Standard
   Storage = DiskChanger
-  Write Bootstrap = "@working_dir@/migrate.bsr"
+  Write Bootstrap = "@working_dir@/migratejob.bsr"
   Pool = Default
   Maximum Concurrent Jobs = 4
   Selection Type = Job 
   Selection Pattern = ".*Save"
 }
 
+Job {
+  Name = "migrate-volume"
+  Type = Migrate
+  Level = Full
+  Client=@hostname@-fd 
+  FileSet="Full Set"
+  Messages = Standard
+  Storage = DiskChanger
+  Write Bootstrap = "@working_dir@/migratevol.bsr"
+  Pool = Default
+  Maximum Concurrent Jobs = 4
+  Selection Type = Volume
+  Selection Pattern = "File*"
+}
+
+
 # Standard Restore template, to be changed by Console program
 Job {
   Name = "RestoreFiles"
index e57d6ba1c1e0ec18617d2975efdf6f2ad57064a3..10de2c45e5e6f64b26b97050284a452c1fc95bb1 100755 (executable)
@@ -7,7 +7,7 @@
 TestName="fixed-block-size-tape"
 JobName=fixedblocksize
 . scripts/functions
-set_debug 1
+set_debug 0
 
 copy_tape_confs
 
index dc8dff7a5a6556b62f58ca4183ad844f63ddde5a..bb88142221f06b1b9eac2754f8fb41d8a284e4b9 100755 (executable)
@@ -35,9 +35,12 @@ label storage=File volume=FileVolume001 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 two jobs (both will be migrated)
+run job=$JobName yes
 run job=$JobName yes
 wait
 list volumes
+@# should migrate two jobs
 run job=migrate yes
 list volumes
 wait
diff --git a/regress/tests/migration-volume-test b/regress/tests/migration-volume-test
new file mode 100755 (executable)
index 0000000..81d7a33
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory then migrate it
+#   to another device.
+#
+# This script uses the virtual disk autochanger
+#
+TestName="migration-volume-test"
+JobName=MigrationVolSave
+. scripts/functions
+set_debug 1
+
+. config.out
+
+scripts/copy-migration-confs
+scripts/prepare-two-disks
+scripts/cleanup
+echo "${cwd}/build" >/tmp/file-list
+
+change_jobname NightlySave $JobName
+start_test
+
+#
+# Note, we first backup into Pool Default, 
+#          then Migrate into Pool Full. 
+#              Pool Default uses Storage=File
+#              Pool Full    uses Storage=DiskChanger
+
+# Write out bconsole commands
+cat <<END_OF_DATA >tmp/bconcmds
+@output
+messages
+@$out tmp/log1.out
+label storage=File volume=FileVolume001 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 two jobs (both will be migrated)
+run job=$JobName yes
+run job=$JobName yes
+wait
+update volume=FileVolume001 VolStatus=Used
+list volumes
+@# should migrate two jobs
+run job=migrate-volume yes
+list volumes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@$out 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
+exit
+end_test