]> git.sur5r.net Git - bacula/bacula/commitdiff
More scripting parameterization
authorKern Sibbald <kern@sibbald.com>
Sat, 9 May 2009 19:12:08 +0000 (19:12 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 9 May 2009 19:12:08 +0000 (19:12 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8818 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/cleanup
regress/scripts/config_dart
regress/scripts/copy-confs
regress/scripts/copy-tape-confs
regress/scripts/copy-test-confs
regress/scripts/create_sed
regress/scripts/do_sed
regress/scripts/functions
regress/scripts/set_tape_options
regress/tests/fileregexp-test

index 6cb2bd09aae2a615b1b03422014ebd4a476fdcdd..5c53dc579b575fa49ff6f89409da028466f95cff 100755 (executable)
@@ -2,29 +2,29 @@
 #
 # Cleanup left over files -- both before and after test run
 #
+. scripts/functions
 cwd=`pwd`
-rm -rf ${cwd}/tmp/FileVolume*
-rm -rf ${cwd}/tmp/TestVolume001 ${cwd}/tmp/bacula-restores ${cwd}/tmp/Small*
-rm -rf ${cwd}/tmp/sed_tmp ${cwd}/tmp/file-list
-rm -rf tmp/*
-rm -rf working/log tmp/TEST-*
-rm -rf working/*.bsr
-rm -rf working/*.trace
-rm -rf ${cwd}/tmp/disk-changer
+rm -rf ${tmp}/FileVolume*
+rm -rf ${tmp}/TestVolume001 ${tmp}bacula-restores ${tmp}/Small*
+rm -rf ${tmp}/sed_tmp ${tmp}/file-list
+rm -rf ${tmp}/*
+rm -rf ${working}/log ${tmp}/TEST-*
+rm -rf ${working}/*.bsr
+rm -rf ${working}/*.trace
+rm -rf ${tmp}disk-changer
 find . -name "gigaslam.gif" -exec rm -f {} \;
 
 
 # bin directory does not always exist
-if [ -d bin ]
-then
-  bin/bacula stop 2>&1 >/dev/null
-  cd bin
+if [ -d ${bin} ] ; then
+  ${bin}/bacula stop 2>&1 >/dev/null
+  cd ${scripts}
   ./drop_bacula_tables      >/dev/null 2>&1
   ./make_bacula_tables      >/dev/null 2>&1
   ./grant_bacula_privileges >/dev/null 2>&1
-  cd ..
+  cd ${cwd}
 fi
 
 if [ x$USE_VTAPE = xyes ]; then
-   rm -rf working/ach
+   rm -rf ${working}/ach
 fi
index 264acb7731289040a116a70ea375e430f5eb6abb..22e3bb9c34e1cf367f8f02f9e58b65cf54303ca5 100755 (executable)
@@ -3,21 +3,21 @@
 # Configure the dart files
 #
 cwd=`pwd`
-. ${cwd}/config
 
-mkdir -p ${cwd}/bin
-out="${cwd}/tmp/sed_tmp"
+mkdir -p ${bin}
+out="${tmp}/sed_tmp"
 
 # pull in latest Bacula version
-cd ${BACULA_SOURCE}
+cd ${src}
 svn update src/version.h
 cd ${cwd}
 
 scripts/create_sed
 
 
-sed -f ${out} ${cwd}/DartConfiguration.tcl.in >${cwd}/DartConfiguration.tcl
-sed -f ${out} ${cwd}/DartTestfile.txt.in >${cwd}/DartTestfile.txt
-
-sed -f ${out} ${cwd}/scripts/update-ctest.in >${cwd}/scripts/update-ctest
-chmod +x ${cwd}/scripts/update-ctest
+if test -f ${cwd}/DartConfiguration.tcl.in ; then
+  sed -f ${out} ${cwd}/DartConfiguration.tcl.in >${cwd}/DartConfiguration.tcl
+  sed -f ${out} ${cwd}/DartTestfile.txt.in >${cwd}/DartTestfile.txt
+  sed -f ${out} ${cwd}/scripts/update-ctest.in >${cwd}/scripts/update-ctest
+  chmod +x ${cwd}/scripts/update-ctest
+fi
index 0bde53e6aa62b25398f7c51631c2015421e280fb..92c59a9cf82b1714a49452638d5103fbb2627e3e 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
-/bin/cp -f scripts/bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/bconsole.conf bin/bconsole.conf
+. scripts/functions
+/bin/cp -f ${rscripts}/bacula-dir.conf ${scripts}/bacula-dir.conf
+/bin/cp -f ${rscripts}/bacula-sd.conf ${scripts}/bacula-sd.conf
+/bin/cp -f ${rscripts}/bacula-fd.conf ${scripts}/bacula-fd.conf
+/bin/cp -f ${rscripts}/bconsole.conf ${scripts}/bconsole.conf
 
-scripts/set_tape_options
+${rscripts}/set_tape_options
index 4a312c5ce850ba4969195ac14ee524fcdc433c3e..c6de726d04c6eb38d0bc5c7c6ebf1303837e76ee 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
-/bin/cp -f scripts/bacula-dir-tape.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd-tape.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
+/bin/cp -f ${rscripts}/bacula-dir-tape.conf ${scripts}/bacula-dir.conf
+/bin/cp -f ${rscripts}/bacula-sd-tape.conf ${scripts}/bacula-sd.conf
+/bin/cp -f ${rscripts}/test-bacula-fd.conf ${scripts}/bacula-fd.conf
+/bin/cp -f ${rscripts}/test-console.conf ${scripts}/bconsole.conf
 
-scripts/set_tape_options
+${rscripts}/set_tape_options
index f9749ca1c155d7e1bd082081926b7a759c05cfda..7c0ccd9d988e1520286cc0a9053b825c6a6dd017 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
-/bin/cp -f scripts/new-test-bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
+/bin/cp -f ${rscripts}/new-test-bacula-dir.conf ${bin}/bacula-dir.conf
+/bin/cp -f ${rscripts}/test-bacula-sd.conf ${bin}/bacula-sd.conf
+/bin/cp -f ${rscripts}/test-bacula-fd.conf ${bin}/bacula-fd.conf
+/bin/cp -f ${rscripts}/test-console.conf ${bin}/bconsole.conf
 
-scripts/set_tape_options
+${rscripts}/set_tape_options
index d78de95aa3edba5b14f9628533577eea5c3c46ad..f2ac478cc17d41355825ac8ff42d52126c81e555 100755 (executable)
@@ -4,9 +4,9 @@
 #
 cwd=`pwd`
 . ${cwd}/scripts/functions
-mkdir -p ${cwd}/bin
-mkdir -p ${cwd}/tmp
-out="${cwd}/tmp/sed_tmp"
+mkdir -p ${bin}
+mkdir -p ${tmp}
+out="${tmp}/sed_tmp"
 
 # set ports and other default parameters
 BASEPORT=${BASEPORT:-8101}
@@ -30,24 +30,24 @@ fi
 dbengine=`echo ${WHICHDB} | sed -e 's/--with-//' -e 's/=.*//'`
 bversion=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
 bdate=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
-builddir="${cwd}/build"
+builddir="${src}"
 
 # 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%@sbindir@%${bin}%g" >${out}
+echo "s%@scriptdir@%${scripts}%g" >>${out}
+echo "s%@working_dir@%${working}%g" >>${out}
+echo "s%@piddir@%${working}%g" >>${out}
+echo "s%@subsysdir@%${working}%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%@changer_script@%${AUTOCHANGER_SCRIPT}%g" >>${out}
-echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
+echo "s%@tmpdir@%${tmp}%g" >>${out}
 echo "s%@hostname@%${HOST}%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 "s%@disk_drive@%${tmp}/disk-changer%g" >>${out}
 echo "s%@hostname@%${hostname}%g" >>${out}
 echo "s%@hostname1@%${hostname1}%g" >>${out}
 echo "s%@hostname2@%${hostname2}%g" >>${out}
index a5ac8be9b8933ed9afb74c3fb68016ed9fa22816..2c1c2280c77320270d72e837f2f03d9d25edb454 100755 (executable)
@@ -1,87 +1,89 @@
 #!/bin/sh
 #
 cwd=`pwd`
-. ${cwd}/scripts/functions
-mkdir -p ${cwd}/bin
-out="${cwd}/tmp/sed_tmp"
+. scripts/functions
+mkdir -p ${bin}
+out="${tmp}/sed_tmp"
 
-scripts/create_sed
+${rscripts}/create_sed
 
 # process .in files with sed script
-sed -f ${out} ${cwd}/scripts/bacula-dir.conf.errors.in >${cwd}/scripts/bacula-dir.conf.errors
-sed -f ${out} ${cwd}/scripts/bacula-dir.conf.accurate.in >${cwd}/scripts/bacula-dir.conf.accurate
-sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/multi-client-bacula-dir.conf.in >${cwd}/scripts/multi-client-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir.conf.regexwhere.in >${cwd}/scripts/bacula-dir.conf.regexwhere
-sed -f ${out} ${cwd}/scripts/bacula-dir.conf.maxtime.in >${cwd}/scripts/bacula-dir.conf.maxtime
-sed -f ${out} ${cwd}/scripts/bacula-dir.conf.maxruntime.in >${cwd}/scripts/bacula-dir.conf.maxruntime
-sed -f ${out} ${cwd}/scripts/new-test-bacula-dir.conf.in >${cwd}/scripts/new-test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/plugin-test-bacula-dir.conf.in >${cwd}/scripts/plugin-test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/testb-bacula-dir.conf.in >${cwd}/scripts/testb-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-fd.conf.in >${cwd}/scripts/test-bacula-fd.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-sd.conf
-sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf
-sed -f ${out} ${cwd}/scripts/crypto-bacula-fd.conf.in >${cwd}/scripts/crypto-bacula-fd.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-tape.conf.in >${cwd}/scripts/bacula-dir-tape.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-2client.conf.in >${cwd}/scripts/bacula-dir-2client.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-fifo.conf.in >${cwd}/scripts/bacula-dir-fifo.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-strip.conf.in >${cwd}/scripts/bacula-dir-strip.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-migration.conf.in >${cwd}/scripts/bacula-dir-migration.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-virtual.conf.in >${cwd}/scripts/bacula-dir-virtual.conf
-sed -f ${out} ${cwd}/scripts/win32-bacula-dir-tape.conf.in >${cwd}/scripts/win32-bacula-dir-tape.conf
-sed -f ${out} ${cwd}/scripts/win32-bacula-dir.conf.in >${cwd}/scripts/win32-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-tape.conf.in >${cwd}/scripts/bacula-sd-tape.conf
-sed -f ${out} ${cwd}/scripts/ansi-sd-tape.conf.in >${cwd}/scripts/ansi-sd-tape.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-fifo.conf.in >${cwd}/scripts/bacula-sd-fifo.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-2tape.conf.in >${cwd}/scripts/bacula-sd-2tape.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-migration.conf.in >${cwd}/scripts/bacula-sd-migration.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-virtual.conf.in >${cwd}/scripts/bacula-sd-virtual.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-2disk.conf.in >${cwd}/scripts/bacula-sd-2disk.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-2drive.conf.in >${cwd}/scripts/bacula-sd-2drive.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-2disk-drive.conf.in >${cwd}/scripts/bacula-sd-2disk-drive.conf
-sed -f ${out} ${cwd}/scripts/broken-media-bug-bacula-dir.conf.in >${cwd}/scripts/broken-media-bug-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/broken-media-bug-2-bacula-dir.conf.in >${cwd}/scripts/broken-media-bug-2-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/broken-media-bug-2-bacula-sd.conf.in >${cwd}/scripts/broken-media-bug-2-bacula-sd.conf
-sed -f ${out} ${cwd}/scripts/cleanup-tape.in >${cwd}/scripts/cleanup-tape
-sed -f ${out} ${cwd}/scripts/cleanup-2tape.in >${cwd}/scripts/cleanup-2tape
-sed -f ${out} ${cwd}/scripts/cleanup-2drive.in >${cwd}/scripts/cleanup-2drive
-sed -f ${out} ${cwd}/scripts/prepare-two-tapes.in >${cwd}/scripts/prepare-two-tapes
-sed -f ${out} ${cwd}/scripts/bacula-dir.conf.testrunscript.in >${cwd}/scripts/bacula-dir.conf.testrunscript
-sed -f ${out} ${cwd}/scripts/bacula-dir-vtape.conf.in >${cwd}/scripts/bacula-dir-vtape.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-vtape.conf.in >${cwd}/scripts/bacula-sd-vtape.conf
-sed -f ${out} ${cwd}/scripts/prepare-fake-autochanger.in >${cwd}/scripts/prepare-fake-autochanger
-sed -f ${out} ${cwd}/scripts/tls-bacula-fd.conf.in >${cwd}/scripts/tls-bacula-fd.conf
-sed -f ${out} ${cwd}/scripts/tls-bacula-sd.conf.in >${cwd}/scripts/tls-bacula-sd.conf
-sed -f ${out} ${cwd}/scripts/tls-bacula-dir.conf.in >${cwd}/scripts/tls-bacula-dir.conf
+sed -f ${out} ${rscripts}/bacula-dir.conf.errors.in >${rscripts}/bacula-dir.conf.errors
+sed -f ${out} ${rscripts}/bacula-dir.conf.accurate.in >${rscripts}/bacula-dir.conf.accurate
+sed -f ${out} ${rscripts}/test-bacula-dir.conf.in >${rscripts}/test-bacula-dir.conf
+sed -f ${out} ${rscripts}/multi-client-bacula-dir.conf.in >${rscripts}/multi-client-bacula-dir.conf
+sed -f ${out} ${rscripts}/bacula-dir.conf.regexwhere.in >${rscripts}/bacula-dir.conf.regexwhere
+sed -f ${out} ${rscripts}/bacula-dir.conf.maxtime.in >${rscripts}/bacula-dir.conf.maxtime
+sed -f ${out} ${rscripts}/bacula-dir.conf.maxruntime.in >${rscripts}/bacula-dir.conf.maxruntime
+sed -f ${out} ${rscripts}/new-test-bacula-dir.conf.in >${rscripts}/new-test-bacula-dir.conf
+sed -f ${out} ${rscripts}/plugin-test-bacula-dir.conf.in >${rscripts}/plugin-test-bacula-dir.conf
+sed -f ${out} ${rscripts}/testa-bacula-dir.conf.in >${rscripts}/testa-bacula-dir.conf
+sed -f ${out} ${rscripts}/testb-bacula-dir.conf.in >${rscripts}/testb-bacula-dir.conf
+sed -f ${out} ${rscripts}/test-bacula-fd.conf.in >${rscripts}/test-bacula-fd.conf
+sed -f ${out} ${rscripts}/test-bacula-sd.conf.in >${rscripts}/test-bacula-sd.conf
+sed -f ${out} ${rscripts}/test-console.conf.in >${rscripts}/test-console.conf
+sed -f ${out} ${rscripts}/crypto-bacula-fd.conf.in >${rscripts}/crypto-bacula-fd.conf
+sed -f ${out} ${rscripts}/bacula-dir-tape.conf.in >${rscripts}/bacula-dir-tape.conf
+sed -f ${out} ${rscripts}/bacula-dir-2client.conf.in >${rscripts}/bacula-dir-2client.conf
+sed -f ${out} ${rscripts}/bacula-dir-fifo.conf.in >${rscripts}/bacula-dir-fifo.conf
+sed -f ${out} ${rscripts}/bacula-dir-strip.conf.in >${rscripts}/bacula-dir-strip.conf
+sed -f ${out} ${rscripts}/bacula-dir-migration.conf.in >${rscripts}/bacula-dir-migration.conf
+sed -f ${out} ${rscripts}/bacula-dir-virtual.conf.in >${rscripts}/bacula-dir-virtual.conf
+sed -f ${out} ${rscripts}/win32-bacula-dir-tape.conf.in >${rscripts}/win32-bacula-dir-tape.conf
+sed -f ${out} ${rscripts}/win32-bacula-dir.conf.in >${rscripts}/win32-bacula-dir.conf
+sed -f ${out} ${rscripts}/bacula-sd-tape.conf.in >${rscripts}/bacula-sd-tape.conf
+sed -f ${out} ${rscripts}/ansi-sd-tape.conf.in >${rscripts}/ansi-sd-tape.conf
+sed -f ${out} ${rscripts}/bacula-sd-fifo.conf.in >${rscripts}/bacula-sd-fifo.conf
+sed -f ${out} ${rscripts}/bacula-sd-2tape.conf.in >${rscripts}/bacula-sd-2tape.conf
+sed -f ${out} ${rscripts}/bacula-sd-migration.conf.in >${rscripts}/bacula-sd-migration.conf
+sed -f ${out} ${rscripts}/bacula-sd-virtual.conf.in >${rscripts}/bacula-sd-virtual.conf
+sed -f ${out} ${rscripts}/bacula-sd-2disk.conf.in >${rscripts}/bacula-sd-2disk.conf
+sed -f ${out} ${rscripts}/bacula-sd-2drive.conf.in >${rscripts}/bacula-sd-2drive.conf
+sed -f ${out} ${rscripts}/bacula-sd-2disk-drive.conf.in >${rscripts}/bacula-sd-2disk-drive.conf
+sed -f ${out} ${rscripts}/broken-media-bug-bacula-dir.conf.in >${rscripts}/broken-media-bug-bacula-dir.conf
+sed -f ${out} ${rscripts}/broken-media-bug-2-bacula-dir.conf.in >${rscripts}/broken-media-bug-2-bacula-dir.conf
+sed -f ${out} ${rscripts}/broken-media-bug-2-bacula-sd.conf.in >${rscripts}/broken-media-bug-2-bacula-sd.conf
+sed -f ${out} ${rscripts}/cleanup-tape.in >${rscripts}/cleanup-tape
+sed -f ${out} ${rscripts}/cleanup-2tape.in >${rscripts}/cleanup-2tape
+sed -f ${out} ${rscripts}/cleanup-2drive.in >${rscripts}/cleanup-2drive
+sed -f ${out} ${rscripts}/prepare-two-tapes.in >${rscripts}/prepare-two-tapes
+sed -f ${out} ${rscripts}/bacula-dir.conf.testrunscript.in >${rscripts}/bacula-dir.conf.testrunscript
+sed -f ${out} ${rscripts}/bacula-dir-vtape.conf.in >${rscripts}/bacula-dir-vtape.conf
+sed -f ${out} ${rscripts}/bacula-sd-vtape.conf.in >${rscripts}/bacula-sd-vtape.conf
+sed -f ${out} ${rscripts}/prepare-fake-autochanger.in >${rscripts}/prepare-fake-autochanger
+sed -f ${out} ${rscripts}/tls-bacula-fd.conf.in >${rscripts}/tls-bacula-fd.conf
+sed -f ${out} ${rscripts}/tls-bacula-sd.conf.in >${rscripts}/tls-bacula-sd.conf
+sed -f ${out} ${rscripts}/tls-bacula-dir.conf.in >${rscripts}/tls-bacula-dir.conf
 
-sed -f ${out} ${cwd}/scripts/tls-auth-bacula-fd.conf.in >${cwd}/scripts/tls-auth-bacula-fd.conf
-sed -f ${out} ${cwd}/scripts/tls-auth-bacula-sd.conf.in >${cwd}/scripts/tls-auth-bacula-sd.conf
-sed -f ${out} ${cwd}/scripts/tls-auth-bacula-dir.conf.in >${cwd}/scripts/tls-auth-bacula-dir.conf
+sed -f ${out} ${rscripts}/tls-auth-bacula-fd.conf.in >${rscripts}/tls-auth-bacula-fd.conf
+sed -f ${out} ${rscripts}/tls-auth-bacula-sd.conf.in >${rscripts}/tls-auth-bacula-sd.conf
+sed -f ${out} ${rscripts}/tls-auth-bacula-dir.conf.in >${rscripts}/tls-auth-bacula-dir.conf
 
 
-sed -f ${out} ${cwd}/scripts/bacula-fd-2d.conf.in >${cwd}/scripts/bacula-fd-2d.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-2d.conf.in >${cwd}/scripts/bacula-sd-2d.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-2d.conf.in >${cwd}/scripts/bacula-dir-2d.conf
-sed -f ${out} ${cwd}/scripts/bconsole-2d.conf.in >${cwd}/scripts/bconsole-2d.conf
-sed -f ${out} ${cwd}/scripts/regress-config.in >${cwd}/scripts/regress-config
-chmod 755 ${cwd}/scripts/regress-config
+sed -f ${out} ${rscripts}/bacula-fd-2d.conf.in >${rscripts}/bacula-fd-2d.conf
+sed -f ${out} ${rscripts}/bacula-sd-2d.conf.in >${rscripts}/bacula-sd-2d.conf
+sed -f ${out} ${rscripts}/bacula-dir-2d.conf.in >${rscripts}/bacula-dir-2d.conf
+sed -f ${out} ${rscripts}/bconsole-2d.conf.in >${rscripts}/bconsole-2d.conf
+sed -f ${out} ${rscripts}/regress-config.in >${rscripts}/regress-config
+chmod 755 ${rscripts}/regress-config
 
 
 # These files have no fancy sed stuff, so we just copy them over
-cp scripts/win32-bacula-sd-tape.conf.in scripts/win32-bacula-sd-tape.conf
-cp scripts/win32-bacula-fd.conf.in      scripts/win32-bacula-fd.conf
+cp ${rscripts}/win32-bacula-sd-tape.conf.in ${rscripts}/win32-bacula-sd-tape.conf
+cp ${rscripts}/win32-bacula-fd.conf.in      ${rscripts}/win32-bacula-fd.conf
 
-cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/bac$$
-sed s%/tmp%${cwd}/tmp%g ${cwd}/tmp/bac$$ >${cwd}/bin/bacula-sd.conf
-chmod 755 ${cwd}/scripts/cleanup-*tape ${cwd}/scripts/cleanup-*drive ${cwd}/scripts/prepare-two-tapes 
-rm -f ${cwd}/tmp/bac$$
-cp ${cwd}/bin/mtx-changer ${cwd}/tmp/bac$$
-sed "s%^MTX.*$%MTX=${AUTOCHANGER_PATH}%g" ${cwd}/tmp/bac$$ >${cwd}/bin/mtx-changer
-chmod 755 ${cwd}/bin/mtx-changer ${cwd}/scripts/prepare-fake-autochanger
+if test -f ${scripts}/bacula-sd.conf ; then
+  cp ${scripts}/bacula-sd.conf ${tmp}/bac$$
+  sed "s% /tmp%${tmp}%g" ${tmp}/bac$$ >${scripts}/bacula-sd.conf
+fi
+chmod 755 ${rscripts}/cleanup-*tape ${rscripts}/cleanup-*drive ${rscripts}/prepare-two-tapes 
+rm -f ${tmp}/tmp/bac$$
+cp ${scripts}/mtx-changer ${tmp}/bac$$
+sed "s%^MTX.*$%MTX=${AUTOCHANGER_PATH}%g" ${tmp}/bac$$ >${scripts}/mtx-changer
+chmod 755 ${scripts}/mtx-changer ${rscripts}/prepare-fake-autochanger
 
-scripts/set_tape_options
-scripts/config_dart
+${rscripts}/set_tape_options
+${rscripts}/config_dart
 
 rm -f ${out}
-rm -f ${cwd}/tmp/bac$$
+rm -f ${tmp}/bac$$
index 15aea131067724b0f44fd1f65b528aa897650176..7c02a454ddc4d8f70a9102570bb3e119f06a0223 100644 (file)
@@ -24,7 +24,7 @@ start_test()
    echo " "
    echo " "
    echo " === Starting $TestName at `date +%R:%S` ==="
-   echo " === Starting $TestName at `date +%R:%S` ===" >> working/log
+   echo " === Starting $TestName at `date +%R:%S` ===" >> ${working}/log
    echo " "
    export zstat
 }
@@ -442,12 +442,20 @@ db_user=${db_user:-"regress"}
 db_password=${db_password:-""}
 working=${working:-"$cwd/working"}
 bin=${bin:-"$cwd/bin"}
+
 # Bacula scripts
 scripts=${scripts:-"$bin"}
+
 # Regress scripts
 rscripts=${rscripts:-"$cwd/scripts"}
+
 tmp=${tmp:-"$cwd/tmp"}
+
+# Bacula source directory when copied here
+#  also build directory
 src=${src:-"$cwd/build"}
+
+# Temp source directory so we don't mess up $src
 tmpsrc=${tmpsrc:-"$cwd/tmp/build"}
 
 export bin
index d7970aa5831b5e6f20d6835e2c88955fa8100462..56afa4f35b2273536411c5577e1c091d74f6f221 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh 
-. ./config
+. scripts/functions
 # get proper SD tape definitions
-cp -f scripts/linux_tape_options bin/tape_options
+cp -f ${rscripts}/linux_tape_options ${bin}/tape_options
 if test x`uname` = xFreeBSD ; then
-   cp -f scripts/freebsd_tape_options bin/tape_options
+   cp -f ${rscripts}/freebsd_tape_options ${bin}/tape_options
 fi
 if test x${USE_VTAPE} = xyes ; then
-  echo "  Device Type = vtape" >>bin/tape_options
+  echo "  Device Type = vtape" >>${bin}/tape_options
 fi
index 2b36575b09f1b25fd4b2fc1f7ffd4bbd7c4bf5af..a30d1285772aaa4cedaf1ef5bfa32be4f9ea253e 100755 (executable)
@@ -14,19 +14,19 @@ scripts/copy-confs
 # Zap out any schedule in default conf file so that
 #  it doesn't start during our test
 #
-outf="tmp/sed_tmp"
+outf="${tmp}/sed_tmp"
 echo "s%  Schedule =%# Schedule =%g" >${outf}
 echo "s%File Retention =%File Retention = 2 #%" >>  ${outf}
-cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
-sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
+cp ${scripts}/bacula-dir.conf ${tmp}/1
+sed -f ${outf} ${tmp}/1 >${scripts}/bacula-dir.conf
 
 change_jobname Client1 $JobName
 start_test
 
-cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+cat <<END_OF_DATA >${tmp}/bconcmds
 @output /dev/null
 messages
-@$out ${cwd}/tmp/log1.out
+@$out ${tmp}/log1.out
 label volume=TestVolume001 storage=File pool=Default
 run job=$JobName yes
 wait
@@ -36,8 +36,8 @@ prune files yes
 @# 
 @# now do a restore
 @#
-@$out ${cwd}/tmp/log2.out  
-restore where=${cwd}/tmp/bacula-restores
+@$out ${tmp}/log2.out  
+restore where=${tmp}/bacula-restores
 5
 no
 README
@@ -52,17 +52,17 @@ run_bacula
 check_for_zombie_jobs storage=File
 stop_bacula
 
-COUNT_OTHER=`find ${cwd}/tmp/bacula-restores -type f | grep -v README | wc -l`
-COUNT_README=`find ${cwd}/tmp/bacula-restores -type f | grep README | wc -l`
+COUNT_OTHER=`find ${tmp}/bacula-restores -type f | grep -v README | wc -l`
+COUNT_README=`find ${tmp}/bacula-restores -type f | grep README | wc -l`
 
 if [ $COUNT_OTHER -gt 0 -o $COUNT_README -lt 15 ]; then
     print_debug "Found non matching files"
-    print_debug `find ${cwd}/tmp/bacula-restores -type f | grep -v README`
+    print_debug `find ${tmp}/bacula-restores -type f | grep -v README`
     rstat=2
 fi
 
 #check_two_logs         # don't work because of "warning file count mismatch"
-grep "Backup OK" ${cwd}/tmp/log1.out > /dev/null
+grep "Backup OK" ${tmp}/log1.out > /dev/null
 if [ $? -ne 0 ]; then
     print_debug "Found error on backup"
     bstat=2