--- /dev/null
+#
+# Makefile for Bacula regression testing
+#
+# Before running, you must create a file named config containing
+# the configuration parameters. Create it by doing:
+#
+# cp prototype.conf config
+#
+# Then edit config and set the value for what are appropriate for you.
+#
+
+first_rule: all
+
+all:
+
+setup: bacula sed
+
+#
+# Some machines cannot handle the sticky bit and other garbage that
+# is in weird-files, so we load and run it only on Linux machines.
+#
+bacula: all
+ @rm -rf bin build weird-files tmp
+ @rm -f w.tar.gz w.tar
+ @cp weird-files.tar.gz w.tar.gz
+ @-gunzip w.tar.gz
+ @-tar xf w.tar
+ @rm -f w.tar.gz w.tar
+ @rm -rf tmp working
+ mkdir tmp working
+ echo "Doing: scripts/setup"
+ scripts/setup
+
+sed:
+ echo "Doing: scripts/do_sed"
+ scripts/do_sed
+
+# Run all non-root userid tests
+test:
+ ./all-non-root-tests
+
+# run all file and tape tests
+full_test:
+ ./all-tape-and-file-tests
+
+# These tests require you to run as root
+root_test:
+ ./all-root-tests
+
+clean:
+ scripts/cleanup
+ rm -f /tmp/file-list
+ rm -fr tmp/* working/*
+ rm -f test.out
+ rm -f diff
+ rm -f 1 2 3 scripts/1 scripts/2 scripts/3 tests/1 tests/2 tests/3
+ find . -name .#* -exec rm -rf {} \;
+
+# Reset our userid after running as root
+reset:
+ chown -R ${USER}:${USER} . tmp working
+ scripts/cleanup
+ rm -f /tmp/file-list tmp/file-list
+ rm -f tmp/* working/*
+
+distclean: clean
+ rm -rf bin build weird-files weird-files weird-files2 tmp working
+ rm -f scripts/*.conf
+
+++ /dev/null
-#
-# Makefile for Bacula regression testing
-#
-# Note, Makefile is built from Makefile.in, which you should not really
-# need to change, by envoking:
-#
-# ./config <user's configuration>
-# e.g.
-#
-# ./config kern.conf
-#
-#
-
-# suck in user's configuration
-@CONFIG@
-
-first_rule: all
-
-all:
-
-setup: bacula sed
-
-#
-# Some machines cannot handle the sticky bit and other garbage that
-# is in weird-files, so we load and run it only on Linux machines.
-#
-bacula: all
- @rm -rf bin build weird-files tmp
- @rm -f w.tar.gz w.tar
- @cp weird-files.tar.gz w.tar.gz
- @-gunzip w.tar.gz
- @-tar xf w.tar
- @rm -f w.tar.gz w.tar
- @rm -rf tmp working
- mkdir tmp working
- echo "Doing: scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB} ${TCPWRAPPERS} ${OPENSSL}"
- scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB} ${TCPWRAPPERS} ${SMTP_HOST} ${OPENSSL}
-
-sed:
- 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:
- ./all-non-root-tests
-
-# run all file and tape tests
-full_test:
- ./all-tape-and-file-tests
-
-# These tests require you to run as root
-root_test:
- ./all-root-tests
-
-clean:
- scripts/cleanup
- rm -f /tmp/file-list
- rm -fr tmp/* working/*
- rm -f test.out
- rm -f diff
- rm -f 1 2 3 scripts/1 scripts/2 scripts/3 tests/1 tests/2 tests/3
- find . -name .#* -exec rm -rf {} \;
-
-# Reset our userid after running as root
-reset:
- chown -R ${USER}:${USER} . tmp working
- scripts/cleanup
- rm -f /tmp/file-list tmp/file-list
- rm -f tmp/* working/*
-
-distclean: clean
- rm -rf bin build weird-files weird-files weird-files2 tmp working
- rm -f scripts/*.conf
-
To set it up, create your personal configuration file, by
-copying prototype.conf to xxx.conf or simply editing prototype.conf
-directly.
+copying prototype.conf to config or simply editing prototype.conf
+directly then copying it to the file config.
-Then edit your conf file and define appropriate values
-for the variables that are in that file. If you want to see
-a real example, look at kern.conf, but please don't use my
-email address!
+You must end up with a file named config in the main regress
+directory that has all the specifications that correspond to
+your system.
If you are using SQLite, make sure that depkgs is pre-built if it
isn't already: (cd your-depkgs; make sqlite).
Then do:
- ./config xxx.conf
make setup
You run the above one time. This will build a Makefile from
+++ /dev/null
-#/bin/sh
-#
-# First argument is expected to be a user's configuration file
-#
-if ! test -f $1 ; then
- echo "Arg1 must specify a config file (e.g. prototype.conf)"
- exit 1
-fi
-sed -e "/@CONFIG@/r $1" -e "s/@CONFIG@//" Makefile.in >Makefile
# Bacula configuration options here, such as --disable-batch-insert
#
OPENSSL="--with-openssl"
+
+# You may put your real host name here, but localhost is valid also
+# and it has the advantage that it works on a non-newtworked machine
+HOST="localhost"
#!/bin/sh
#
-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
cwd=`pwd`
+. ${cwd}/config
mkdir -p ${cwd}/bin
out="/tmp/sed_tmp"
-HOST="localhost"
# Create sed command script
echo "s%@sbindir@%${cwd}/bin%g" >${out}
echo "s%@scriptdir@%${cwd}/bin%g" >>${out}
echo "s%@working_dir@%${cwd}/working%g" >>${out}
echo "s%@piddir@%${cwd}/working%g" >>${out}
echo "s%@subsysdir@%${cwd}/working%g" >>${out}
-echo "s%@job_email@%${1}%g" >>${out}
-echo "s%@tape_drive@%${2}%g" >>${out}
-echo "s%@autochanger@%${3}%g" >>${out}
+echo "s%@job_email@%${EMAIL}%g" >>${out}
+echo "s%@tape_drive@%${TAPE_DRIVE}%g" >>${out}
+echo "s%@autochanger@%${AUTOCHANGER}%g" >>${out}
echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
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}
+echo "s%@changer_path@%${AUTOCHANGER_PATH}%g" >>${out}
+echo "s%@tape_drive1@%${TAPE_DRIVE1}%g" >>${out}
+echo "s%@smtp_host@%${SMTP_HOST}%g" >>${out}
echo "s%@disk_drive@%${cwd}/tmp/disk-changer%g" >>${out}
-echo "# " >config.out
-echo "# Autochanger conf" >>config.out
-echo "# " >>config.out
-echo "AUTOCHANGER=\"${3}\"" >>config.out
-echo "TAPE_DRIVE1=\"${5}\"" >>config.out
-
# process .in files with sed script
sed -f ${out} ${cwd}/scripts/bacula-dir.conf.errors.in >${cwd}/scripts/bacula-dir.conf.errors
chmod 777 ${cwd}/scripts/cleanup-*tape ${cwd}/scripts/cleanup-*drive ${cwd}/scripts/prepare-two-tapes
rm -f /tmp/bac$$
cp ${cwd}/bin/mtx-changer /tmp/bac$$
-sed "s%^MTX.*$%MTX=${4}%g" /tmp/bac$$ >${cwd}/bin/mtx-changer
+sed "s%^MTX.*$%MTX=${AUTOCHANGER_PATH}%g" /tmp/bac$$ >${cwd}/bin/mtx-changer
chmod 777 ${cwd}/bin/mtx-changer
# get proper SD tape definitions
set_debug 0
fi
-# Source the second drive variables
-touch ${cwd}/config.out
-. ${cwd}/config.out
+# Source the configuration variables
+. ${cwd}/config
# This is the configuration script for regression testing
#
-if test "x${CONFIG_SHELL}" != "x"; then
- CONFIG_SHELL=/bin/sh
-fi
+. ${1}/config
-# Handle Solaris compiler (possibly some others)
-VERSION="`cc --version | head -1 | awk '{ print $2 }' 2> /dev/null`"
-
-if [ -n "${VERSION}" -a "${VERSION}" = "(GCC)" ]; then
- OPTIMIZE="-O2"
- WARNINGS="-Wall"
-else
- OPTIMIZE="-O"
- WARNINGS="-v"
-fi
-
-CFLAGS="-g ${OPTIMIZE} ${WARNINGS}" \
+CFLAGS="-g -O2 -Wall" \
./configure \
- --sbindir=$1/bin \
- --sysconfdir=$1/bin \
- --mandir=$1/bin \
- --with-pid-dir=$1/working \
- --with-subsys-dir=$1/working \
+ --sbindir=${1}/bin \
+ --sysconfdir=${1}/bin \
+ --mandir=${1}/bin \
+ --with-pid-dir=${1}/working \
+ --with-subsys-dir=${1}/working \
--enable-smartalloc \
--disable-readline \
- --with-working-dir=$1/working \
- --with-dump-email=$2 \
- --with-job-email=$2 \
- --with-smtp-host=$5 \
+ --with-working-dir=${1}/working \
+ --with-dump-email=${EMAIL} \
+ --with-job-email=${EMAIL} \
+ --with-smtp-host=${SMTP_HOST} \
--with-db-name=regress \
--with-db-user=regress \
- $3 \
- --with-baseport=8101 \
- $4 \
- $6
+ ${OPENSSL} \
+ ${TCPWRAPPERS} \
+ ${WHICHDB} \
+ --with-baseport=8101
exit 0
fi
}
+. ./config
+
cwd=`pwd`
-if [ $# != 6 ] ; then
- echo "Incorrect number of arguments. Got $#. Need:"
- echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
- echo " "
- exit 1
-fi
-if [ ! -d $1 ] ; then
+if [ ! -d ${BACULA_SOURCE} ] ; then
echo "Arg 1 must be a Bacula release directory."
echo " "
exit 1
fi
rm -rf build bin
# Copy new source
-echo "Copying source from $1"
-cp -rp $1 build
+echo "Copying source from ${BACULA_SOURCE}"
+cp -rp ${BACULA_SOURCE} build
cp scripts/regress-config build
cd build
rm -f Makefile config.cache
# Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3 $4 $5 $6
+./regress-config ${cwd}
check_exit_code
# Cleanup any win32 build in source
cd src/win32