]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/migration-job-test
Add migration job test
[bacula/bacula] / regress / tests / migration-job-test
diff --git a/regress/tests/migration-job-test b/regress/tests/migration-job-test
new file mode 100755 (executable)
index 0000000..dc8dff7
--- /dev/null
@@ -0,0 +1,66 @@
+#!/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-job-test"
+JobName=MigrationJobSave
+. scripts/functions
+set_debug 0
+
+. 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 job=$JobName yes
+wait
+list volumes
+run job=migrate 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
+end_test