]> git.sur5r.net Git - bacula/bacula/commitdiff
Rename manual tape test
authorKern Sibbald <kern@sibbald.com>
Thu, 24 Jul 2008 06:41:38 +0000 (06:41 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 24 Jul 2008 06:41:38 +0000 (06:41 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7428 91ce42f0-d328-0410-95d8-f526ca767f89

regress/DartTestfile.txt.in
regress/all-tape-tests
regress/tests/bad-label-changer [new file with mode: 0755]
regress/tests/manual-two-vol-tape [new file with mode: 0755]
regress/tests/two-vol-manual-tape [deleted file]
regress/tests/virtual-backup-test [new file with mode: 0755]

index 5ff91ba72661d6994c55ab9798621c7e147c17ca..272b88a782b2383bb3af82b60dbfdea02d6407e6 100644 (file)
@@ -79,7 +79,7 @@ ADD_TEST(tape:verify-vol-tape "@regressdir@/tests/verify-vol-tape")
 ADD_TEST(changer:incremental-changer "@regressdir@/tests/incremental-changer")
 ADD_TEST(changer:two-pool-changer "@regressdir@/tests/two-pool-changer")
 ADD_TEST(changer:two-volume-changer "@regressdir@/tests/two-volume-changer")
-# ADD_TEST(changer:two-vol-manual-tape "@regressdir@/tests/two-vol-manual-tape")
+# ADD_TEST(changer:manual-two-vol-tape "@regressdir@/tests/manual-two-vol-tape")
 ADD_TEST(changer:vol-duration-changer "@regressdir@/tests/vol-duration-changer")
 
 ADD_TEST(2drive-changer:2drive-incremental-changer "@regressdir@/tests/2drive-incremental-changer")
index 8db518b9ea91bb08ac348623254725985893f375..c50a4726b83b944baac2559db45f1951d5f60896 100755 (executable)
@@ -28,6 +28,6 @@ nice tests/restore-by-file-tape
 nice tests/small-file-size-tape
 nice tests/truncate-bug-tape
 nice tests/verify-vol-tape
-# nice tests/two-vol-manual-tape
+nice tests/manual-two-vol-tape
 echo "End all non-root tape tests"
 echo "End all non-root tape tests" >>test.out
diff --git a/regress/tests/bad-label-changer b/regress/tests/bad-label-changer
new file mode 100755 (executable)
index 0000000..419ed7e
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Label two tapes, write to the first, then recycle it and destroy
+#  the header.  Bacula should discover that, mark the tape in 
+#  error and continue onto the second tape.
+#
+TestName="bad-label-changer"
+JobName=badlabelchanger
+. scripts/functions
+
+require_tape_drive
+require_autochanger
+
+scripts/cleanup
+scripts/copy-2tape-confs
+scripts/prepare-two-tapes
+echo "${cwd}/build" >${cwd}/tmp/file-list
+
+outf="tmp/sed_tmp"
+echo "s%# Maximum File Size%  Maximum File Size%g" >${outf}
+cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
+sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
+
+change_jobname $JobName
+start_test
+
+# Write out bconsole commands
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@$out tmp/log1.out
+label storage=DDS-4 volume=TestVolume002 slot=$SLOT2 pool=Default drive=$DRIVE1
+label storage=DDS-4 volume=TestVolume001 slot=$SLOT1 pool=Default drive=$DRIVE1
+@#setdebug level=10 client=$CLIENT 
+setdebug level=150 storage=DDS-4
+run job=$JobName yes
+wait
+purge volume=TestVolume001
+messages
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+# Overwrite TestVolume001 label
+init_drive ${TAPE_DRIVE}
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+list volumes
+run job=$JobName level=Full storage=DDS-4 yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@$out tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test
diff --git a/regress/tests/manual-two-vol-tape b/regress/tests/manual-two-vol-tape
new file mode 100755 (executable)
index 0000000..e5a80aa
--- /dev/null
@@ -0,0 +1,108 @@
+#!/bin/sh
+#
+# Run a job with a limited tape size so that the tape fills up.
+#  Then manually unload the tape and load a new one, label
+#  it.
+#
+TestName="two-vol-manual-tape"
+JobName=twovolmanualtape
+. scripts/functions
+
+require_tape_drive
+require_autochanger
+
+scripts/cleanup
+scripts/copy-tape-confs
+echo "${cwd}/build" >${cwd}/tmp/file-list
+MTX=$AUTOCHANGER_SCRIPT
+
+# Sleep longer if real tape
+if [ x${USE_VTAPE} = xyes ] ; then
+   sleep=20 
+else
+   sleep=90
+fi
+
+slot=0
+export slot
+
+# TODO -- check this
+init_slot $TAPE_DRIVE $SLOT1
+init_slot $TAPE_DRIVE $SLOT2
+
+load_slot1
+
+init_drive ${TAPE_DRIVE}
+
+change_jobname $JobName
+start_test
+
+# Label second volume
+cat <<END_OF_DATA >tmp/bconcmds
+@out /dev/null
+messages
+@$out tmp/log1.out
+label storage=DDS-4 volume=TestVolume002 slot=0 pool=Default drive=0
+unmount storage=DDS-4
+quit
+END_OF_DATA
+
+run_bacula
+
+# Load slot2
+load_other_slot $slot
+init_drive ${TAPE_DRIVE}
+
+# label first volume, and run first half of job
+cat <<END_OF_DATA >tmp/bconcmds
+@$out tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default drive=0
+update Volume=TestVolume001 MaxVolBytes=500000 pool=Default drive=0
+list volumes
+setdebug level=150 storage=DDS-4
+run job=$JobName yes
+@# This sleep must be long enough for the first tape to fill (4MB)
+@#  otherwise the following mtx-changer commands will fail
+@sleep $sleep
+list volumes
+unmount storage=DDS-4
+list volumes
+status storage=DDS-4
+messages
+quit
+END_OF_DATA
+
+run_bconsole
+
+load_other_slot $slot
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out tmp/log1.out
+mount storage=DDS-4
+@# backup should continue
+wait
+@# 
+@# now do a restore
+@#
+@#restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
+@#yes
+wait
+list volumes
+messages
+@$out
+quit
+END_OF_DATA
+
+# run second half of backup + restore
+run_bconsole
+
+touch tmp/log2.out
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+check_two_logs
+#check_restore_diff
+dstat=0   # no diff
+rstat=0   # no restore
+end_test
diff --git a/regress/tests/two-vol-manual-tape b/regress/tests/two-vol-manual-tape
deleted file mode 100755 (executable)
index e5a80aa..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/bin/sh
-#
-# Run a job with a limited tape size so that the tape fills up.
-#  Then manually unload the tape and load a new one, label
-#  it.
-#
-TestName="two-vol-manual-tape"
-JobName=twovolmanualtape
-. scripts/functions
-
-require_tape_drive
-require_autochanger
-
-scripts/cleanup
-scripts/copy-tape-confs
-echo "${cwd}/build" >${cwd}/tmp/file-list
-MTX=$AUTOCHANGER_SCRIPT
-
-# Sleep longer if real tape
-if [ x${USE_VTAPE} = xyes ] ; then
-   sleep=20 
-else
-   sleep=90
-fi
-
-slot=0
-export slot
-
-# TODO -- check this
-init_slot $TAPE_DRIVE $SLOT1
-init_slot $TAPE_DRIVE $SLOT2
-
-load_slot1
-
-init_drive ${TAPE_DRIVE}
-
-change_jobname $JobName
-start_test
-
-# Label second volume
-cat <<END_OF_DATA >tmp/bconcmds
-@out /dev/null
-messages
-@$out tmp/log1.out
-label storage=DDS-4 volume=TestVolume002 slot=0 pool=Default drive=0
-unmount storage=DDS-4
-quit
-END_OF_DATA
-
-run_bacula
-
-# Load slot2
-load_other_slot $slot
-init_drive ${TAPE_DRIVE}
-
-# label first volume, and run first half of job
-cat <<END_OF_DATA >tmp/bconcmds
-@$out tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default drive=0
-update Volume=TestVolume001 MaxVolBytes=500000 pool=Default drive=0
-list volumes
-setdebug level=150 storage=DDS-4
-run job=$JobName yes
-@# This sleep must be long enough for the first tape to fill (4MB)
-@#  otherwise the following mtx-changer commands will fail
-@sleep $sleep
-list volumes
-unmount storage=DDS-4
-list volumes
-status storage=DDS-4
-messages
-quit
-END_OF_DATA
-
-run_bconsole
-
-load_other_slot $slot
-
-cat <<END_OF_DATA >tmp/bconcmds
-@$out tmp/log1.out
-mount storage=DDS-4
-@# backup should continue
-wait
-@# 
-@# now do a restore
-@#
-@#restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
-@#yes
-wait
-list volumes
-messages
-@$out
-quit
-END_OF_DATA
-
-# run second half of backup + restore
-run_bconsole
-
-touch tmp/log2.out
-check_for_zombie_jobs storage=DDS-4
-stop_bacula
-
-check_two_logs
-#check_restore_diff
-dstat=0   # no diff
-rstat=0   # no restore
-end_test
diff --git a/regress/tests/virtual-backup-test b/regress/tests/virtual-backup-test
new file mode 100755 (executable)
index 0000000..d9872a0
--- /dev/null
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory then do a virtual
+#   backup to another device.
+#
+# This script uses the virtual disk autochanger
+#
+TestName="virtual-backup-test"
+JobName=Vbackup
+. scripts/functions
+
+
+scripts/cleanup
+scripts/copy-migration-confs
+scripts/prepare-two-disks
+echo "${cwd}/build" >${cwd}/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 >${cwd}/tmp/bconcmds
+@output
+messages
+@$out ${cwd}/tmp/log1.out
+@#setdebug level=100 storage=File
+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
+@# run several jobs
+run job=$JobName level=Full yes
+wait
+messages
+list jobs
+@exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
+run job=$JobName level=Incremental yes
+wait
+messages
+list jobs
+@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
+run job=$JobName level=Differential yes
+wait
+messages
+list jobs
+@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
+run job=$JobName level=Incremental yes
+wait
+messages
+list jobs
+list volumes
+setdebug level=100 dir
+@# should migrate two jobs
+@#setdebug level=51 storage=DiskChanger
+run job=$JobName level=VirtualFull yes
+wait
+messages
+list volumes
+list jobs
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+list volumes
+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