From daa1b94113d1eddbfd1dcf10e0fd376045ea4974 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 24 Jul 2008 06:41:38 +0000 Subject: [PATCH] Rename manual tape test git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7428 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/DartTestfile.txt.in | 2 +- regress/all-tape-tests | 2 +- regress/tests/bad-label-changer | 76 ++++++++++++++++ ...wo-vol-manual-tape => manual-two-vol-tape} | 0 regress/tests/virtual-backup-test | 87 +++++++++++++++++++ 5 files changed, 165 insertions(+), 2 deletions(-) create mode 100755 regress/tests/bad-label-changer rename regress/tests/{two-vol-manual-tape => manual-two-vol-tape} (100%) create mode 100755 regress/tests/virtual-backup-test diff --git a/regress/DartTestfile.txt.in b/regress/DartTestfile.txt.in index 5ff91ba726..272b88a782 100644 --- a/regress/DartTestfile.txt.in +++ b/regress/DartTestfile.txt.in @@ -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") diff --git a/regress/all-tape-tests b/regress/all-tape-tests index 8db518b9ea..c50a4726b8 100755 --- a/regress/all-tape-tests +++ b/regress/all-tape-tests @@ -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 index 0000000000..419ed7eba2 --- /dev/null +++ b/regress/tests/bad-label-changer @@ -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 <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 <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/two-vol-manual-tape b/regress/tests/manual-two-vol-tape similarity index 100% rename from regress/tests/two-vol-manual-tape rename to regress/tests/manual-two-vol-tape diff --git a/regress/tests/virtual-backup-test b/regress/tests/virtual-backup-test new file mode 100755 index 0000000000..d9872a0d63 --- /dev/null +++ b/regress/tests/virtual-backup-test @@ -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 <${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 -- 2.39.2