]> git.sur5r.net Git - bacula/bacula/commitdiff
Update + add migration tests
authorKern Sibbald <kern@sibbald.com>
Sat, 19 Aug 2006 12:07:27 +0000 (12:07 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 19 Aug 2006 12:07:27 +0000 (12:07 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3305 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tests
regress/scripts/bacula-dir-migration.conf.in
regress/tests/migration-job-test
regress/tests/migration-occupancy-test [new file with mode: 0755]
regress/tests/migration-test [deleted file]
regress/tests/migration-time-test [new file with mode: 0755]

index 8eff3fde0e5ddc4236dd13e6cf7cd74c0f1f0eeb..e782ca24225e83409aa835d630b737d8acd48088 100755 (executable)
@@ -32,6 +32,7 @@ tests/weird-files2-test
 tests/weird-files-test
 tests/migration-job-test
 tests/migration-volume-test
+tests/migration-time-test
 # 
 # The following are Virtual Disk Autochanger tests
 tests/two-pool-test
index f14cf8a22696fb8f74a2dcfda6697e045c7330d8..cd5309e0784926a413361b641ef97b22d82108fe 100644 (file)
@@ -41,7 +41,7 @@ Job {
 }
 
 Job {
-  Name = "migrate"
+  Name = "migrate-job"
   Type = Migrate
   Level = Full
   Client=@hostname@-fd 
@@ -70,6 +70,36 @@ Job {
   Selection Pattern = "File*"
 }
 
+Job {
+  Name = "migrate-occupancy"
+  Type = Migrate
+  Level = Full
+  Client=@hostname@-fd 
+  FileSet="Full Set"
+  Messages = Standard
+  Storage = DiskChanger
+  Write Bootstrap = "@working_dir@/migratejob.bsr"
+  Pool = Default
+  Maximum Concurrent Jobs = 4
+  Selection Type = PoolOccupancy
+}
+
+Job {
+  Name = "migrate-time"
+  Type = Migrate
+  Level = Full
+  Client=@hostname@-fd 
+  FileSet="Full Set"
+  Messages = Standard
+  Storage = DiskChanger
+  Write Bootstrap = "@working_dir@/migratejob.bsr"
+  Pool = Default
+  Maximum Concurrent Jobs = 4
+  Selection Type = PoolTime
+}
+
+
+
 
 # Standard Restore template, to be changed by Console program
 Job {
@@ -184,6 +214,9 @@ Pool {
   Volume Retention = 365d             # one year
   NextPool = Full
   Storage = File
+  Migration High Bytes = 40M
+  Migration Low Bytes = 20M
+  Migration Time = 60
 }
 
 Pool {
index fccf7af6468da7cd2af47cc2303967bf39c3f83b..d243c9971246ecd7356feafb78927e0182736ab4 100755 (executable)
@@ -41,7 +41,7 @@ run job=$JobName yes
 wait
 list volumes
 @# should migrate two jobs
-run job=migrate yes
+run job=migrate-job yes
 list volumes
 wait
 messages
diff --git a/regress/tests/migration-occupancy-test b/regress/tests/migration-occupancy-test
new file mode 100755 (executable)
index 0000000..e5c9e35
--- /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-occupancy-test"
+JobName=MigrationJobSave
+. scripts/functions
+set_debug 0
+
+. config.out
+
+scripts/cleanup
+scripts/copy-migration-confs
+scripts/prepare-two-disks
+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-occupancy yes
+list volumes
+wait
+messages
+wait
+@# 
+@# 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
+end_test
diff --git a/regress/tests/migration-test b/regress/tests/migration-test
deleted file mode 100755 (executable)
index 2846a70..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/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-test"
-JobName=MigrationSave
-. scripts/functions
-set_debug 1
-
-. config.out
-
-scripts/cleanup
-scripts/copy-migration-confs
-scripts/prepare-two-disks
-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
-@$out /dev/null
-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 job=$JobName yes
-list volumes
-run job=migrate
-list volumes
-@# 
-@# 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
-end_test
diff --git a/regress/tests/migration-time-test b/regress/tests/migration-time-test
new file mode 100755 (executable)
index 0000000..0b57426
--- /dev/null
@@ -0,0 +1,78 @@
+#!/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-time-test"
+JobName=MigrationJobSave
+. scripts/functions
+set_debug 0
+
+. config.out
+
+scripts/cleanup
+scripts/copy-migration-confs
+scripts/prepare-two-disks
+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 three jobs
+run job=$JobName level=Full yes
+run job=$JobName level=Full yes
+run job=$JobName level=Full yes
+wait
+update volume=FileVolume001 VolStatus=Used
+sql
+update Job SET RealEndTime='2004-01-01 12:01:01' WHERE JobId IN (2,3);
+
+llist jobid=2,3
+list jobs
+list volumes
+@# should migrate only jobid=2 and 3
+run job=migrate-time yes
+wait
+messages
+wait
+list jobs
+list volumes
+@# 
+@# 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
+end_test