From d93a5544dd090df7b45e6d709640ba8845f5cd4b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 25 Jun 2008 21:18:18 +0000 Subject: [PATCH] Manual drive change code git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7235 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/scripts/functions | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/regress/scripts/functions b/regress/scripts/functions index 4a63c5c7dd..6fa0378e51 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -293,6 +293,44 @@ init_drive() fi } +rewind_drive() +{ + if test a$USE_VTAPE = a; then + mt -f $1 rewind + fi +} + + +# +# $1 has currently loaded slot, load the other one i.e. if 1, load 2; +# if 2, load 1; if 0 load 1 +# +load_other_slot() +{ +rewind_drive ${TAPE_DRIVE} +case $1 in + 0) + bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 + slot=1 + ;; + $SLOT1) + bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} unload $1 ${TAPE_DRIVE} $DRIVE1 + bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT2 ${TAPE_DRIVE} $DRIVE1 + slot=2 + ;; + $SLOT2) + bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} unload $1 ${TAPE_DRIVE} $DRIVE1 + bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 + slot=1 + ;; + *) + echo "Something went wrong. Expected $SLOT1 or $SLOT2, got $1" + exit 1 + ;; +esac +} + + # Save current directory cwd=`pwd` if test "x${REGRESS_DEBUG}" = "x1"; then -- 2.39.5