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")
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
--- /dev/null
+#!/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
--- /dev/null
+#!/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