ADD_TEST(disk:2drive-swap-test "@regressdir@/tests/2drive-swap-test")
 ADD_TEST(disk:2drive-concurrent-test "@regressdir@/tests/2drive-concurrent-test")
 ADD_TEST(disk:2drive-incremental-2disk "@regressdir@/tests/2drive-incremental-2disk")
+
 ADD_TEST(changer:incremental-2tape "@regressdir@/tests/incremental-2tape")
 ADD_TEST(changer:two-volume-tape "@regressdir@/tests/two-volume-tape")
+ADD_TEST(changer:two-vol-manual-tape "@regressdir@/tests/two-vol-manual-tape")
+
 ADD_TEST(tape:ansi-label-tape "@regressdir@/tests/ansi-label-tape")
 ADD_TEST(tape:backup-bacula-tape "@regressdir@/tests/backup-bacula-tape")
 ADD_TEST(tape:bscan-tape "@regressdir@/tests/bscan-tape")
 ADD_TEST(tape:truncate-bug-tape "@regressdir@/tests/truncate-bug-tape")
 ADD_TEST(tape:two-pool-tape "@regressdir@/tests/two-pool-tape")
 ADD_TEST(tape:verify-vol-tape "@regressdir@/tests/verify-vol-tape")
+
 ADD_TEST(root:dev-test-root "@regressdir@/tests/dev-test-root")
 ADD_TEST(root:etc-test-root "@regressdir@/tests/etc-test-root")
 ADD_TEST(root:lib-test-root "@regressdir@/tests/lib-test-root")
 
 nice tests/2drive-incremental-2tape
 nice tests/bscan-tape
 nice tests/verify-vol-tape
+nice tests/two-vol-manual-tape
 echo "End all non-root tape tests"
 echo "End all non-root tape tests" >>test.out
 
 # For two drive tests -- set to /dev/null if you do not have it 
 TAPE_DRIVE1="/dev/null"
 
+# Set this if you are using fake tape driver
+#USE_VTAPE=yes
+
+# Change this to use disk-changer with vtape
+AUTOCHANGER_SCRIPT=mtx-changer
+
 # This must be the path to the autochanger including its name
 AUTOCHANGER_PATH="/usr/sbin/mtx"
 
 #WHICHDB="--with-postgresql"
 WHICHDB="--with-mysql" 
 
+# DB parameters
+db_name="regress"
+db_user="regress"
+db_password=
+
+# Set this if you use libdbi framework
+#LIBDBI="dbdriver = "dbi:postgresql"; dbaddress = 127.0.0.1; dbport = 5432"
+
 # Set this to "--with-tcp-wrappers" or "--without-tcp-wrappers"
 TCPWRAPPERS="--with-tcp-wrappers"
 
 #  test machines, add some indication of the machine.
 #
 SITE_NAME=<your-name>-bacula-${HOST}
+
+#
+# The following are used only if you want to run Win32 tests, which
+#   is a real pain since the Win32 machine is not localhost and you
+#   also need to specify what to backup.
+#
+WIN32_CLIENT="yyyy"
+WIN32_ADDR="yyyy"
+WIN32_FILE="c:/users/xxxx"
+WIN32_PORT=9102
+WIN32_PASSWORD="zzzzz"
 
 mkdir -p ${cwd}/tmp
 out="${cwd}/tmp/sed_tmp"
 
-# set the ports used by these tests
+# set ports and other default parameters
 BASEPORT=${BASEPORT:-8101}
 AUTOCHANGER_SCRIPT=${AUTOCHANGER_SCRIPT:-mtx-changer}
+LIBDBI=${LIBDBI:-}
+libdbi=${LIBDBI}
 srcdir=${BACULA_SOURCE}
 dirport=${BASEPORT}
 fdport=`expr ${BASEPORT} '+' 1`
 sdport=`expr ${BASEPORT} '+' 2`
+db_name=${db_name:-"regress"}
+db_user=${db_user:-"regress"}
+db_password=${db_password:-""}
 os=`uname -s`-`./scripts/get-os`
 dbengine=`echo ${WHICHDB} | sed -e 's/--with-//' -e 's/=.*//'`
 bversion=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
 echo "s%@os@%${os}%g" >>${out}
 echo "s%@bversion@%${bversion}%g" >>${out}
 echo "s%@bdate@%${bdate}%g" >>${out}
+echo "s%@libdbi@%${libdbi}%g" >>${out}
+echo "s%@win32_client@%${WIN32_CLIENT}%g" >>${out}
+echo "s%@win32_addr@%${WIN32_ADDR}%g" >>${out}
+echo "s%@win32_file@%${WIN32_FILE}%g" >>${out}
+echo "s%@win32_port@%${WIN32_PORT}%g" >>${out}
+echo "s%@win32_password@%${WIN32_PASSWORD}%g" >>${out}
+echo "s%@db_name@%${db_name}%g" >>${out}
+echo "s%@db_user@%${db_user}%g" >>${out}
+echo "s%@db_password@%${db_password}%g" >>${out}
 
 fi
 }
 
-require_faketape() 
+require_vtape() 
 {
-if test x${USE_FAKETAPE} = x ; then
-   echo "$TestName test needs the faketape driver."
-   exit 1
+if test x${USE_VTAPE} = x ; then
+   echo "$TestName test needs the vtape driver."
+   exit 0
+fi
+}
+
+require_linux()
+{
+os=`uname`
+if [ $os != 'Linux' ]; then
+   echo "This test $TestName runs only on Linux"
+   exit 0
 fi
 }
 
   fi
 }
 
+init_slot()
+{
+   DRIVE=$1
+   SLOT=$2
+   if test -n "$DRIVE" -a -n "$SLOT"; then
+      if test ! -c $DRIVE -a ! -b $DRIVE -a x$USE_VTAPE != x ; then
+         dir=`dirname $DRIVE`
+         touch $dir/slot$SLOT
+      fi
+   fi
+}
+
 init_drive()
 {
-  if test a$USE_FAKETAPE = a; then
+  if test a$USE_VTAPE = a; then
     mt -f $1 rewind
     mt -f $1 weof
   else