ADD_TEST(all-non-root:2drive-incremental-2disk "@regressdir@/tests/2drive-incremental-2disk")
ADD_TEST(all-non-root-2tape:incremental-2tape "@regressdir@/tests/incremental-2tape")
ADD_TEST(all-non-root-2tape:two-volume-tape "@regressdir@/tests/two-volume-tape")
-ADD_TEST(all-non-root-tape:2drive-incremental-2t2da-tape "@regressdir@/tests/2drive-incremental-2t2da-tape")
+ADD_TEST(all-non-root-2drive-tape:2drive-incremental-2t2da-tape "@regressdir@/tests/2drive-incremental-2t2da-tape")
ADD_TEST(all-non-root-tape:ansi-label-1t1d-tape "@regressdir@/tests/ansi-label-1t1d-tape")
ADD_TEST(all-non-root-tape:backup-bacula-1t1d-tape "@regressdir@/tests/backup-bacula-1t1d-tape")
ADD_TEST(all-non-root-tape:bscan-1t1d-tape "@regressdir@/tests/bscan-1t1d-tape")
SQLITE3_DIR=${HOME}/bacula/depkgs/sqlite3
SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
+# set to /dev/null if you do not have a tape drive
TAPE_DRIVE="/dev/nst0"
+
# if you don't have an autochanger set AUTOCHANGER to /dev/null
AUTOCHANGER="/dev/sg0"
+
# For two drive tests -- set to /dev/null if you do not have it
TAPE_DRIVE1="/dev/null"
# test machines, add some indication of the machine.
#
SITE_NAME=<your-name>-bacula-${HOST}
-
#
scripts/cleanup
+a=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
+if test $a = 0 ; then
+ bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0
+fi
mt -f @tape_drive@ rewind
mt -f @tape_drive@ weof
fi
}
+require_tape_drive()
+{
+if test x${TAPE_DRIVE} = x/dev/null ; then
+ echo "$TestName test needs a tape drive, but has none."
+ exit 1
+fi
+}
+
+require_second_drive()
+{
+if test x${TAPE_DRIVE1} = x/dev/null ; then
+ echo "$JobName needs second drive, but has none."
+ exit 1
+fi
+}
+
+require_autochanger()
+{
+if test x${AUTOCHANGER} = x/dev/null ; then
+ echo "$TestName needs an autochanger, but has none."
+ exit 1
+fi
+}
+
+
skip_if_no_autochanger()
{
if test x${AUTOCHANGER} = x/dev/null ; then
echo "$TestName test skipped. No autochanger."
exit
fi
-
}
set_debug()
# Run a simple backup of the Bacula build directory then create some
# new files, do an Incremental and restore those two files.
#
-# This script uses the autochanger and two tapes
+# This script uses the autochanger and two drives
#
TestName="2drive-incremental-2t2da-tape"
JobName="2drive2tape"
. scripts/functions
-if test x${TAPE_DRIVE1} = x/dev/null ; then
- echo "Skipping 2drive-incremental-2tape test. No second drive."
- exit
-fi
+require_tape_drive
+require_autochanger
+require_second_drive
scripts/copy-2drive-confs
# Run a simple backup of the Bacula build directory then create some
# new files, do an Incremental and restore those two files.
#
-# This script uses the autochanger and two tapes
+# This script uses the autochanger and two drives
#
TestName="2drive-incremental-2t2da-tape"
JobName="2drive2tape"
. scripts/functions
-if test x${TAPE_DRIVE1} = x/dev/null ; then
- echo "Skipping 2drive-incremental-2tape test. No second drive."
- exit
-fi
-
+require_tape_drive
+require_autochanger
+require_second_drive
scripts/copy-2drive-confs
scripts/cleanup-2drive
JobName=backuptape
. scripts/functions
+require_tape_drive
+
scripts/copy-tape-confs
/bin/cp -f scripts/ansi-sd-tape.conf bin/bacula-sd.conf
scripts/cleanup-tape
JobName=backuptape
. scripts/functions
+require_tape_drive
+
scripts/copy-tape-confs
scripts/cleanup-tape
JobName=backupwintape
. scripts/functions
+require_tape_drive_drive
+
scripts/cleanup-tape
scripts/copy-win32-confs
JobName=bscantape
. scripts/functions
+require_tape_drive
+
copy_tape_confs
echo "${cwd}/build" >tmp/file-list
JobName=bscantape
. scripts/functions
+require_tape_drive
+
copy_tape_confs
echo "${cwd}/build" >${cwd}/tmp/file-list
JobName=AutoLabel
. scripts/functions
+require_tape_drive
+
scripts/copy-tape-confs
scripts/cleanup-tape
JobName=EightySimultaneousJobs
. scripts/functions
+require_tape_drive
+
scripts/cleanup-tape
scripts/copy-tape-confs
JobName=eotfailtape
. scripts/functions
+require_tape_drive
+
scripts/cleanup-tape
scripts/copy-tape-confs
JobName=fixedblocksize
. scripts/functions
+require_tape_drive
+
copy_tape_confs
echo "${cwd}/build" >${cwd}/tmp/file-list
JobName=FourConcurrentJobs
. scripts/functions
+require_tape_drive
+
scripts/cleanup-tape
scripts/copy-tape-confs
JobName=fourjobstape
. scripts/functions
+require_tape_drive
+
scripts/cleanup-tape
scripts/copy-tape-confs
echo "${cwd}/build" >${cwd}/tmp/file-list
JobName=IncTape
. scripts/functions
+require_tape_drive
+
scripts/copy-tape-confs
scripts/cleanup-tape
JobName=Inc2mediaTape
. scripts/functions
+require_tape_drive
+require_second_drive
scripts/cleanup
# Get conf files
JobName=FourConcurrentJobs
. scripts/functions
+require_tape_drive
+
scripts/cleanup-tape
scripts/copy-tape-confs
JobName=Relabeltape
. scripts/functions
+require_tape_drive
+
scripts/cleanup-tape
scripts/copy-tape-confs
TestName="restore-by-file-1t1d-tape"
JobName=restorebyfile
. scripts/functions
+
+require_tape_drive
+
scripts/copy-tape-confs
scripts/cleanup-tape
JobName=restore-tape-seek
. scripts/functions
+require_tape_drive
+
scripts/copy-tape-confs
scripts/cleanup-tape
JobName=smallfilesize
. scripts/functions
+require_tape_drive
+
scripts/copy-tape-confs
scripts/cleanup-tape
JobName=truncatebug
. scripts/functions
+require_tape_drive
+
scripts/copy-tape-confs
scripts/cleanup-tape
JobName=twopooltape
. scripts/functions
-skip_if_no_autochanger
+require_tape_drive
+require_autochanger
scripts/cleanup
scripts/copy-2tape-confs
JobName=twovoltape
. scripts/functions
-if test x${AUTOCHANGER} = x/dev/null ; then
- echo "${TestName} test skipped. No autochanger."
- exit
-fi
+require_tape_drive
+require_autochanger
scripts/cleanup
scripts/copy-2tape-confs
JobName=VerifyVol
. scripts/functions
+require_tape_drive
+
scripts/copy-tape-confs
scripts/cleanup-tape
JobName=VolDuration
. scripts/functions
-skip_if_no_autochanger
+require_tape_drive
+require_autochanger
scripts/cleanup
scripts/copy-2tape-confs
JobName=win32tape
. scripts/functions
+require_tape_drive
+
scripts/copy-win32-confs
scripts/cleanup-tape
JobName=AutoLabel
. scripts/functions
+require_tape_drive
+
scripts/copy-win32-confs
scripts/cleanup-tape