--- /dev/null
+#!/bin/sh
+# /home/kern/bacula/bin/startmysql
+nice make setup
+echo " " >test.out
+cat build/config.out >>test.out
+echo " " >>test.out
+echo "Test results" >>test.out
+echo " " >>test.out
+./starttime
+nice ./all-non-root-tests
+echo " "
+echo "End do_file tests"
+echo "End do_file tests" >>test.out
+scripts/cleanup
+cat test.out
+./endtime
. scripts/functions
scripts/cleanup
-
-if test x@autochanger@ != x/dev/null; then
- slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
- if test "x${slot}" != "x$SLOT2"; then
- bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
- bin/@changer_script@ @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
- fi
-
- 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/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
- if test "x${slot}" != "x$SLOT1"; then
- bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
- bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
- fi
-fi
-
-init_drive @tape_drive@
-
+scripts/prepare-two-tapes
#!/bin/sh
#
-# Cleanup left over files -- both before and after test run
+# Cleanup left over files, then load $SLOT1 into drive and
+# write an EOF on it.
#
+
. scripts/functions
scripts/cleanup
-if test "x@autochanger@" != "x/dev/null" ; then
- a=`bin/@changer_script@ @autochanger@ loaded $SLOT1 @tape_drive@ 0`
- if test $a = 0 ; then
- bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ 0
- fi
+if test x@autochanger@ != x/dev/null; then
+ slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
+ case $slot in
+ 0)
+ bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
+ ;;
+ $SLOT1)
+ ;;
+ default)
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
+ ;;
+ esac
fi
init_drive @tape_drive@
-
# A set of useful functions to be sourced in each test
#
+
start_test()
{
# Turn off email
fi
}
-require_faketape()
+require_faketape()
{
if test x${USE_FAKETAPE} = x ; then
echo "$TestName test needs the faketape driver."
fi
}
+bscan_libdbi()
+{
+ B=`echo $LIBDBI | sed 's/;//' | sed 's/;//g'`
+ B_D=`echo $B | awk '{print $3}'`
+ B_t=`echo $B | awk '{print $6}'`
+ B_p=`echo $B | awk '{print $9}'`
+
+ BSCANLIBDBI="${LIBDBI:+1}"
+
+ if test "$BSCANLIBDBI" = "1" ; then
+ BSCANLIBDBI="-D $B_D -h $B_t -t $B_p"
+ else
+ BSCANLIBDBI=" "
+ fi
+}
stop_bacula()
{
# Source the configuration variables
. ${cwd}/config
+
+CLIENT=${HOST}-fd
+AUTOCHANGER_SCRIPT=${AUTOCHANGER_SCRIPT:-mtx-changer}
#
# Cleanup left over files -- both before and after test run
#
+# Write an EOF on tape in slot $SLOT1 and on tape in $SLOT2
. scripts/functions
scripts/cleanup
-if test x@autochanger@ != x/dev/null; then
- slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
- if test "x${slot}" != "x$SLOT2"; then
- bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
- bin/@changer_script@ @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
- fi
- init_drive @tape_drive@
-fi
-
-
#
-# If we have an autochanger always load tape in slot 1
+# init first of two slots
+# optimize so we don't unnecessarily unload and load slots
#
if test x@autochanger@ != x/dev/null; then
slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1`
- if test "x${slot}" != "x$SLOT1"; then
+ case $slot in
+ 0)
+ bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
+ init_drive @tape_drive@
+ slot=$SLOT1
+ ;;
+ $SLOT1)
+ init_drive @tape_drive@
+ slot=$SLOT1
+ ;;
+ $SLOT2)
+ init_drive @tape_drive@
+ slot=$SLOT2
+ ;;
+ default)
bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
- fi
-fi
-
-init_drive @tape_drive@
+ init_drive @tape_drive@
+ slot=$SLOT1
+ ;;
+ esac
+# init the other slot
+ case $slot in
+ $SLOT1)
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1
+ init_drive @tape_drive@
+ ;;
+ $SLOT2)
+ bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1
+ bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1
+ init_drive @tape_drive@
+ ;;
+ esac
+fi
select * from Storage;
select VolumeName,InChanger,StorageId from Media;
-@#setdebug level=1000 client
+@#setdebug level=1000 client=$CLIENT
run job=$JobName yes
wait
update slots scan storage=DDS-4