From 7452fe9f5162123b4b41eba56b39c09654ec6a81 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 26 Jun 2008 20:37:28 +0000 Subject: [PATCH] Update two-vol-manual-tape git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7241 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/DartTestfile.txt.in | 2 +- regress/all-tape-tests | 2 +- regress/scripts/functions | 20 ++++++++++++++++++++ regress/tests/two-vol-manual-tape | 21 ++++----------------- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/regress/DartTestfile.txt.in b/regress/DartTestfile.txt.in index c955a9fb02..edeba6a2ab 100644 --- a/regress/DartTestfile.txt.in +++ b/regress/DartTestfile.txt.in @@ -78,7 +78,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:two-vol-manual-tape "@regressdir@/tests/two-vol-manual-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 366f8eec04..8db518b9ea 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/two-vol-manual-tape echo "End all non-root tape tests" echo "End all non-root tape tests" >>test.out diff --git a/regress/scripts/functions b/regress/scripts/functions index 6fa0378e51..b3285d9752 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -300,6 +300,26 @@ rewind_drive() fi } +load_slot1() +{ +# Get a tape from slot1 +slot=`bin/$MTX ${AUTOCHANGER} loaded 0 ${TAPE_DRIVE} $DRIVE1` +case $slot in + 0) + bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 + slot=$SLOT1 + ;; + $SLOT1) + slot=$SLOT1 + ;; + *) + rewind_drive ${TAPE_DRIVE} + bin/$MTX ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1 + bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 + slot=$SLOT1 + ;; +esac +} # # $1 has currently loaded slot, load the other one i.e. if 1, load 2; diff --git a/regress/tests/two-vol-manual-tape b/regress/tests/two-vol-manual-tape index 6d38dd9928..ef9bf8f06e 100755 --- a/regress/tests/two-vol-manual-tape +++ b/regress/tests/two-vol-manual-tape @@ -30,23 +30,7 @@ export slot init_slot $TAPE_DRIVE $SLOT1 init_slot $TAPE_DRIVE $SLOT2 -# Get a tape from slot1 -slot=`bin/$MTX ${AUTOCHANGER} loaded 0 ${TAPE_DRIVE} $DRIVE1` -case $slot in - 0) - bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 - slot=$SLOT1 - ;; - $SLOT1) - slot=$SLOT1 - ;; - *) - rewind_drive ${TAPE_DRIVE} - bin/$MTX ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1 - bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 - slot=$SLOT1 - ;; -esac +load_slot1 init_drive ${TAPE_DRIVE} @@ -60,10 +44,12 @@ 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} @@ -88,6 +74,7 @@ END_OF_DATA run_bconsole + load_other_slot $slot init_drive ${TAPE_DRIVE} -- 2.39.5