rm -rf tmp working
mkdir tmp working
echo "Doing: scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB} ${TCPWRAPPERS}"
- scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB} ${TCPWRAPPERS}
+ scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB} ${TCPWRAPPERS} ${SMTP_HOST}
sed:
- echo "Doing: scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH} ${TAPE_DRIVE1}"
- scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH} ${TAPE_DRIVE1}
+ echo "Doing: scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH} ${TAPE_DRIVE1} ${SMTP_HOST}"
+ scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH} ${TAPE_DRIVE1} ${SMTP_HOST}
# Run all non-root userid tests
test:
# Where to get the source to be tested
+# BACULA_SOURCE="${HOME}/bacula/branch-1.36.2"
BACULA_SOURCE="${HOME}/bacula/k"
# Where to send email !!!!! Change me !!!!!!!
EMAIL=kern@sibbald.com
+SMTP_HOST="localhost"
# Full "default" path where to find sqlite (no quotes!)
SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
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/nst1"
# This must be the path to the autochanger including its name
AUTOCHANGER_PATH="/usr/sbin/mtx"
# Set your database here
-WHICHDB="--with-sqlite=${SQLITE_DIR}"
+WHICHDB?="--with-sqlite=${SQLITE_DIR}"
#WHICHDB="--with-mysql=${HOME}/mysql"
# Set this to "--with-tcp-wrappers" or "--without-tcp-wrappers"
# Where to send email messages
#
EMAIL=
+SMTP_HOST=localhost
# Full "default" path where to find sqlite.
# This is only used if you do not specify a database override on the
# Set this to "--with-tcp-wrappers" or "--without-tcp-wrappers"
TCPWRAPPERS="--with-tcp-wrappers"
-
# Message delivery for daemon messages (no job).
Messages {
Name = Daemon
- mailcommand = "/home/kern/bacula/regress/bin/bsmtp -h @smtp_host@ -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
+ mailcommand = "/home/kern/bacula/regress/bin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
mail = kern@sibbald.com = all, !skipped
console = all, !skipped, !saved
append = "/home/kern/bacula/regress/working/log" = all, !skipped
#
scripts/cleanup
-if ! test x@autochanger@ = x/dev/null; then
+if test ! x@autochanger@ = x/dev/null; then
slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
echo "Slot $slot in drive 1"
- if ! test x$slot = x0 ; then
+ if test ! x$slot = x0 ; then
echo "unload slot $slot in drive 1"
bin/mtx-changer @autochanger@ unload $slot @tape_drive1@ 1
fi
slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
echo "Slot $slot in drive 0"
- if ! test x$slot = x0 ; then
+ if test ! x$slot = x0 ; then
echo "unload slot $slot in drive 0"
bin/mtx-changer @autochanger@ unload $slot @tape_drive@ 0
fi
slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
- if ! test x$slot = x2; then
+ if test ! x$slot = x2; then
echo "load slot 2 in drive 1"
bin/mtx-changer @autochanger@ load 2 @tape_drive1@ 1
fi
slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
echo "Slot $slot in drive 0"
- if ! test x$slot = x1; then
+ if test ! x$slot = x1; then
echo "load slot 1 in drive 0"
bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0
fi
#
scripts/cleanup
-if ! test x@autochanger@ = x/dev/null; then
+if test ! x@autochanger@ = x/dev/null; then
drive=`bin/mtx-changer @autochanger@ loaded`
- if ! test x$drive = x2; then
+ if test ! x$drive = x2; then
bin/mtx-changer @autochanger@ unload 0 @tape_drive@ 0
bin/mtx-changer @autochanger@ load 2 @tape_drive@ 0
fi
#
# If we have an autochanger always load tape in slot 1
#
-if ! test x@autochanger@ = x/dev/null; then
+if test ! x@autochanger@ = x/dev/null; then
drive=`bin/mtx-changer @autochanger@ loaded`
- if ! test x$drive = x1; then
+ if test ! x$drive = x1; then
bin/mtx-changer @autochanger@ unload 0 @tape_drive@ 0
bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0
fi
#!/bin/sh
#
-if test $# != 5 ; then
+if test $# != 6 ; then
echo "First arg must be email name"
echo " and the second must be a tape drive"
echo " and the third must be a tape control name or /dev/null"
echo " and the fourth must be the full path to the mtx program"
echo " and the fifth must be tape drive 1 or /dev/null"
+ echo " and the sixth must be the smtp or email host"
exit 1
fi
out="/tmp/sed_tmp"
echo "s%@hostname@%${host}%g" >>${out}
echo "s%@changer_path@%${4}%g" >>${out}
echo "s%@tape_drive1@%${5}%g" >>${out}
+echo "s%@smtp_host@%${6}%g" >>${out}
# process .in files with sed script
sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
# get proper SD tape definitions
touch ${cwd}/bin/tape_options
-if test x`uname` = xLinux ; then \
- cp -f ${cwd}/scripts/linux_tape_options ${cwd}/bin/tape_options ; \
+if test x`uname` = xLinux ; then
+ cp -f ${cwd}/scripts/linux_tape_options ${cwd}/bin/tape_options
fi
-if test x`uname` = xFreeBSD ; then \
- cp -f ${cwd}/scripts/freebsd_tape_options ${cwd}/bin/tape_options ; \
+if test x`uname` = xFreeBSD ; then
+ cp -f ${cwd}/scripts/freebsd_tape_options ${cwd}/bin/tape_options
fi
rm -f ${out}
--with-working-dir=$1/working \
--with-dump-email=$2 \
--with-job-email=$2 \
+ --with-smtp-host=$5 \
$3 \
--with-baseport=8101 \
$4
# Script to setup running Bacula regression tests
#
cwd=`pwd`
-if [ $# != 4 ] ; then
+if [ $# != 5 ] ; then
echo "Incorrect number of arguments. Got $#. Need:"
echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
echo " "
cd build
rm -f Makefile config.cache
# Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3 $4
+./regress-config ${cwd} $2 $3 $4 $5
make
make install
cp src/tools/testls ../bin
@$out /dev/null
messages
@$out tmp/log1.out
-label storage=File volume=TestVolume001
label storage=File volume=TestVolume002
+label storage=File volume=TestVolume001
run job=CompressedTest yes
wait
messages
messages
@$out tmp/log1.out
@# Force differential on the second Volume
-update volume=TestVolume001 VolStatus=Used
+update volume=TestVolume002 VolStatus=Used
run level=differential job=CompressedTest yes
wait
messages
# Run a simple backup of the Bacula build directory but
# split the archive into two volumes
#
+debug=0
+if test "$debug" -eq 1 ; then
+ out="tee"
+else
+ out="output"
+fi
+
cwd=`pwd`
scripts/copy-test-confs
scripts/cleanup
echo " === Starting two-vol-test at `date +%R:%S` ===" >working/log
echo " "
-bin/bacula start 2>&1 >/dev/null
-# bin/bacula start
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-#bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
messages
-@output tmp/log1.out
-label storage=File1 volume=TestVolume001
+@$out tmp/log1.out
label storage=File1 volume=TestVolume002
-update Volume=TestVolume001 MaxVolBytes=3000000
+label storage=File1 volume=TestVolume001
+update Volume=TestVolume002 MaxVolBytes=3000000
run job=NightlySave storage=File1 yes
wait
messages
@#
@# now do a restore
@#
-@output tmp/log2.out
+@$out tmp/log2.out
restore where=${cwd}/tmp/bacula-restores select all storage=File1 done
yes
wait
messages
-@output
+@$out
quit
END_OF_DATA
+
+if test "$debug" -eq 1 ; then
+ bin/bacula start
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
+else
+ bin/bacula start 2>&1 >/dev/null
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
+fi
+
scripts/check_for_zombie_jobs storage=File1
bin/bacula stop 2>&1 >/dev/null
grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null