]> git.sur5r.net Git - bacula/bacula/commitdiff
Restructure regress configuration
authorKern Sibbald <kern@sibbald.com>
Thu, 6 Sep 2007 16:50:58 +0000 (16:50 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 6 Sep 2007 16:50:58 +0000 (16:50 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5480 91ce42f0-d328-0410-95d8-f526ca767f89

regress/Makefile [new file with mode: 0644]
regress/Makefile.in [deleted file]
regress/README
regress/config [deleted file]
regress/prototype.conf
regress/scripts/do_sed
regress/scripts/functions
regress/scripts/regress-config
regress/scripts/setup

diff --git a/regress/Makefile b/regress/Makefile
new file mode 100644 (file)
index 0000000..d33f78c
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# 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
+                     
diff --git a/regress/Makefile.in b/regress/Makefile.in
deleted file mode 100644 (file)
index 6d8c250..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# 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
-                     
index 09dbc73bbefce3931902acd06a135e5135eff348..d289c630a3e70ca2817d11e49e5661e97e1d4ea6 100644 (file)
@@ -13,13 +13,12 @@ system uses MySQL, you can use SQLite here.
 
 
 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).
@@ -38,7 +37,6 @@ SQLite as the database, while my production uses MySQL.
 
 Then do:
 
-   ./config xxx.conf
    make setup
 
 You run the above one time.  This will build a Makefile from
diff --git a/regress/config b/regress/config
deleted file mode 100755 (executable)
index 6088502..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#/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
index eebf5943608eb98de56dbe6c02b4256869b54e70..17053a9423667e38f66a690ef74c4b811135134a 100644 (file)
@@ -35,3 +35,7 @@ TCPWRAPPERS="--with-tcp-wrappers"
 #  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"
index ea614601b3375bc1823415fa69f751c2837cec57..a7f2ac7dc026c9e01421b5fc6cc94d962257836c 100755 (executable)
@@ -1,40 +1,25 @@
 #!/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
@@ -79,7 +64,7 @@ sed s%/tmp%${cwd}/tmp%g /tmp/bac$$ >${cwd}/bin/bacula-sd.conf
 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
index 4791db9c7a247da2cf47ce5042ab4933cd82e8ee..910b57fe047fcc0b0d96c6285575fb6204978f14 100644 (file)
@@ -177,6 +177,5 @@ else
    set_debug 0
 fi
 
-# Source the second drive variables
-touch ${cwd}/config.out
-. ${cwd}/config.out
+# Source the configuration variables
+. ${cwd}/config
index f68ea08fb65d9771ca5a77672406bc139bbc30ba..3d288c83f76930e3c8c9656859176ae34b96738a 100755 (executable)
@@ -3,39 +3,26 @@
 # 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
index 9b592f6664ef357a560c6aea79426ea9647e3379..67a2c9a78052448064ca4fd11c97e0753d6611d2 100755 (executable)
@@ -11,27 +11,23 @@ check_exit_code()
    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