Autochanger {
Name = DDS-4
Changer Device = @autochanger@
- Changer Command ="@scriptdir@/mtx-changer %c %o %S %a %d"
+ Changer Command ="@scriptdir@/@changer_script@ %c %o %S %a %d"
Device = Drive-0
}
Autochanger {
Name = DDS-4
Changer Device = @autochanger@
- Changer Command ="@scriptdir@/mtx-changer %c %o %S %a %d"
+ Changer Command ="@scriptdir@/@changer_script@ %c %o %S %a %d"
Device = Drive-0, Drive-1
}
Autochanger {
Name = DDS-4
Changer Device = @autochanger@
- Changer Command ="@scriptdir@/mtx-changer %c %o %S %a %d"
+ Changer Command ="@scriptdir@/@changer_script@ %c %o %S %a %d"
Device = Drive-0
}
scripts/cleanup
if test x@autochanger@ != x/dev/null; then
- slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive1@ 1`
echo "Slot $slot in drive 1"
if test x$slot != x0 ; then
echo "unload slot $slot in drive 1"
- bin/mtx-changer @autochanger@ unload $slot @tape_drive1@ 1
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive1@ 1
fi
- slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ 0`
echo "Slot $slot in drive 0"
if test x$slot != x0 ; then
echo "unload slot $slot in drive 0"
- bin/mtx-changer @autochanger@ unload $slot @tape_drive@ 0
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ 0
fi
- slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive1@ 1`
if test x$slot != x$SLOT2; then
echo "load slot $SLOT2 in drive 1"
- bin/mtx-changer @autochanger@ load $SLOT2 @tape_drive1@ 1
+ bin/@changer_script@ @autochanger@ load $SLOT2 @tape_drive1@ 1
fi
echo "WEOF drive 1"
mt -f @tape_drive1@ rewind
mt -f @tape_drive1@ weof
echo "unload slot $SLOT2 in drive 1"
- bin/mtx-changer @autochanger@ unload $SLOT2 @tape_drive1@ 1
+ bin/@changer_script@ @autochanger@ unload $SLOT2 @tape_drive1@ 1
- slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ 0`
echo "Slot $slot in drive 0"
if test x$slot != x$SLOT1; then
echo "load slot $SLOT1 in drive 0"
- bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ 0
+ bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ 0
fi
echo "WEOF drive 0"
mt -f @tape_drive@ rewind
mt -f @tape_drive@ weof
echo "unload slot $SLOT1 from drive 0"
- bin/mtx-changer @autochanger@ unload $SLOT1 @tape_drive@ 0
+ bin/@changer_script@ @autochanger@ unload $SLOT1 @tape_drive@ 0
fi
scripts/cleanup
if test x@autochanger@ != x/dev/null; then
- slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1`
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
if test "x${slot}" != "x$SLOT2"; then
- bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1
- bin/mtx-changer @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
fi
- mt -f @tape_drive@ rewind
- mt -f @tape_drive@ weof
+
+ init_drive @tape_drive@
fi
# If we have an autochanger always load tape in slot 1
#
if test x@autochanger@ != x/dev/null; then
- slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1`
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
if test "x${slot}" != "x$SLOT1"; then
- bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1
- bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
fi
fi
-if test a$USE_FAKETAPE = a; then
- mt -f @tape_drive@ rewind
- mt -f @tape_drive@ weof
-else
- cp /dev/null @tape_drive@
-fi
+init_drive @tape_drive@
#
# Cleanup left over files -- both before and after test run
#
-. ./config
+
+. scripts/functions
scripts/cleanup
if test "x@autochanger@" != "x/dev/null" ; then
- a=`bin/mtx-changer @autochanger@ loaded $SLOT1 @tape_drive@ 0`
+ a=`bin/@changer_script@ @autochanger@ loaded $SLOT1 @tape_drive@ 0`
if test $a = 0 ; then
- bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ 0
+ bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ 0
fi
fi
-if test a$USE_FAKETAPE = a; then
- mt -f @tape_drive@ rewind
- mt -f @tape_drive@ weof
-else
- cp /dev/null @tape_drive@
-fi
+init_drive @tape_drive@
+
# set the ports used by these tests
BASEPORT=${BASEPORT:-8101}
+AUTOCHANGER_SCRIPT=${AUTOCHANGER_SCRIPT:-mtx-changer}
LIBDBI=${LIBDBI:- }
libdbi=${LIBDBI}
srcdir=${BACULA_SOURCE}
echo "s%@job_email@%${EMAIL}%g" >>${out}
echo "s%@tape_drive@%${TAPE_DRIVE}%g" >>${out}
echo "s%@autochanger@%${AUTOCHANGER}%g" >>${out}
+echo "s%@changer_script@%${AUTOCHANGER_SCRIPT}%g" >>${out}
echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
echo "s%@hostname@%${HOST}%g" >>${out}
echo "s%@changer_path@%${AUTOCHANGER_PATH}%g" >>${out}
fi
}
+init_drive()
+{
+ if test a$USE_FAKETAPE = a; then
+ mt -f $1 rewind
+ mt -f $1 weof
+ else
+ cp /dev/null $1
+ fi
+}
+
# Save current directory
cwd=`pwd`
if test "x${REGRESS_DEBUG}" = "x1"; then
scripts/cleanup
if test x@autochanger@ != x/dev/null; then
- slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1`
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
if test "x${slot}" != "x$SLOT2"; then
- bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1
- bin/mtx-changer @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
fi
- mt -f @tape_drive@ rewind
- mt -f @tape_drive@ weof
+
+ init_drive @tape_drive@
fi
# If we have an autochanger always load tape in slot 1
#
if test x@autochanger@ != x/dev/null; then
- slot=`bin/mtx-changer @autochanger@ loaded 0 dummy $DRIVE1`
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
if test "x${slot}" != "x$SLOT1"; then
- bin/mtx-changer @autochanger@ unload $slot @tape_drive@ $DRIVE1
- bin/mtx-changer @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
fi
fi
-if test a$USE_FAKETAPE = a; then
- mt -f @tape_drive@ rewind
- mt -f @tape_drive@ weof
-else
- cp /dev/null @tape_drive@
-fi
+init_drive @tape_drive@
+