From: Kern Sibbald Date: Sat, 5 Jul 2008 16:24:16 +0000 (+0000) Subject: Set tape options also vtape in one place X-Git-Tag: Release-3.0.0~1184 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b39867914436e558c1d2f32e8a043fab3a9d99ac;p=bacula%2Fbacula Set tape options also vtape in one place git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7322 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/copy-2drive-confs b/regress/scripts/copy-2drive-confs index 0388c4c175..cccce99b00 100755 --- a/regress/scripts/copy-2drive-confs +++ b/regress/scripts/copy-2drive-confs @@ -8,8 +8,4 @@ echo "s%# Autochanger = yes% Autochanger = yes%g" >${outf} cp bin/bacula-dir.conf tmp/1 sed -f ${outf} tmp/1 >bin/bacula-dir.conf -# get proper SD tape definitions -cp -f scripts/linux_tape_options bin/tape_options -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/copy-2tape-confs b/regress/scripts/copy-2tape-confs index 26f4f01088..73f2eb4493 100755 --- a/regress/scripts/copy-2tape-confs +++ b/regress/scripts/copy-2tape-confs @@ -8,12 +8,4 @@ echo "s%# Autochanger = yes% Autochanger = yes%g" >${outf} cp bin/bacula-dir.conf tmp/1 sed -f ${outf} tmp/1 >bin/bacula-dir.conf -# get proper SD tape definitions -if [ x$USE_VTAPE = xyes ]; then - cp -f scripts/vtape_tape_options bin/tape_options -else - cp -f scripts/linux_tape_options bin/tape_options -fi -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/copy-confs b/regress/scripts/copy-confs index c12a20a359..0bde53e6aa 100755 --- a/regress/scripts/copy-confs +++ b/regress/scripts/copy-confs @@ -4,8 +4,4 @@ /bin/cp -f scripts/bacula-fd.conf bin/bacula-fd.conf /bin/cp -f scripts/bconsole.conf bin/bconsole.conf -# get proper SD tape definitions -cp -f scripts/linux_tape_options bin/tape_options -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/copy-fifo-confs b/regress/scripts/copy-fifo-confs index 812b731967..7e5dbb5ec9 100755 --- a/regress/scripts/copy-fifo-confs +++ b/regress/scripts/copy-fifo-confs @@ -4,8 +4,4 @@ /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf /bin/cp -f scripts/test-console.conf bin/bconsole.conf -# get proper SD tape definitions -cp -f scripts/linux_tape_options bin/tape_options -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/copy-strip-confs b/regress/scripts/copy-strip-confs index 71a0674538..36b67f8b03 100755 --- a/regress/scripts/copy-strip-confs +++ b/regress/scripts/copy-strip-confs @@ -4,8 +4,4 @@ /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf /bin/cp -f scripts/test-console.conf bin/bconsole.conf -# get proper SD tape definitions -cp -f scripts/linux_tape_options bin/tape_options -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/copy-tape-confs b/regress/scripts/copy-tape-confs index afdf869e49..4a312c5ce8 100755 --- a/regress/scripts/copy-tape-confs +++ b/regress/scripts/copy-tape-confs @@ -4,12 +4,4 @@ /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf /bin/cp -f scripts/test-console.conf bin/bconsole.conf -# get proper SD tape definitions -if [ x$USE_VTAPE = xyes ]; then - cp -f scripts/vtape_tape_options bin/tape_options -else - cp -f scripts/linux_tape_options bin/tape_options -fi -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/copy-test-confs b/regress/scripts/copy-test-confs index 5552c77116..f9749ca1c1 100755 --- a/regress/scripts/copy-test-confs +++ b/regress/scripts/copy-test-confs @@ -4,8 +4,4 @@ /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf /bin/cp -f scripts/test-console.conf bin/bconsole.conf -# get proper SD tape definitions -cp -f scripts/linux_tape_options bin/tape_options -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/copy-testa-confs b/regress/scripts/copy-testa-confs index 46116b9f90..b4e2f6b94c 100755 --- a/regress/scripts/copy-testa-confs +++ b/regress/scripts/copy-testa-confs @@ -4,8 +4,4 @@ /bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf /bin/cp -f scripts/test-console.conf bin/bconsole.conf -# get proper SD tape definitions -cp -f scripts/linux_tape_options bin/tape_options -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/copy-win32-confs b/regress/scripts/copy-win32-confs index 7cda59aabc..e3cc5fd8fc 100755 --- a/regress/scripts/copy-win32-confs +++ b/regress/scripts/copy-win32-confs @@ -4,8 +4,4 @@ /bin/cp -f scripts/win32-bacula-fd.conf bin/bacula-fd.conf /bin/cp -f scripts/test-console.conf bin/bconsole.conf -# get proper SD tape definitions -cp -f scripts/linux_tape_options bin/tape_options -if test x`uname` = xFreeBSD ; then - cp -f scripts/freebsd_tape_options bin/tape_options -fi +scripts/set_tape_options diff --git a/regress/scripts/do_sed b/regress/scripts/do_sed index 0294c98308..49ea857646 100755 --- a/regress/scripts/do_sed +++ b/regress/scripts/do_sed @@ -74,11 +74,7 @@ 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 -# get proper SD tape definitions -cp -f ${cwd}/scripts/linux_tape_options ${cwd}/bin/tape_options -if test x`uname` = xFreeBSD ; then - cp -f ${cwd}/scripts/freebsd_tape_options ${cwd}/bin/tape_options -fi +scripts/set_tape_options rm -f ${out} rm -f ${cwd}/tmp/bac$$ diff --git a/regress/scripts/set_tape_options b/regress/scripts/set_tape_options new file mode 100755 index 0000000000..d7970aa583 --- /dev/null +++ b/regress/scripts/set_tape_options @@ -0,0 +1,10 @@ +#!/bin/sh +. ./config +# get proper SD tape definitions +cp -f scripts/linux_tape_options bin/tape_options +if test x`uname` = xFreeBSD ; then + cp -f scripts/freebsd_tape_options bin/tape_options +fi +if test x${USE_VTAPE} = xyes ; then + echo " Device Type = vtape" >>bin/tape_options +fi diff --git a/regress/scripts/vtape_tape_options b/regress/scripts/vtape_tape_options deleted file mode 100644 index 2ac6e4775f..0000000000 --- a/regress/scripts/vtape_tape_options +++ /dev/null @@ -1 +0,0 @@ -DeviceType = Vtape diff --git a/regress/startover_libdbi.sh b/regress/startover_libdbi.sh new file mode 100755 index 0000000000..e37b238c7f --- /dev/null +++ b/regress/startover_libdbi.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Run tests using differents catalog databases + +PWD=`pwd` + +CATALOG_MODE="postgresql postgresql-batchinsert postgresql-dbi postgresql-dbi-batchinsert \ + mysql mysql-batchinsert mysql-dbi mysql-dbi-batchinsert" + +for CT in $CATALOG_MODE ; do + + CATALOG=`echo $CT | cut -d"-" -f1` + DISABLE_BATCH_INSERT=`echo $CT | grep batchinsert` + WITHOUT_DBI=`echo $CT | grep dbi` + + if test "$DISABLE_BATCH_INSERT" = "" ; then + ENABLE_BATCH_INSERT="--disable-batch-insert" + else + ENABLE_BATCH_INSERT="--enable-batch-insert" + fi + + if test "$WITHOUT_DBI" = "" ; then + + _WHICHDB="WHICHDB=\"--disable-nls --with-${CATALOG} ${ENABLE_BATCH_INSERT}\"" + _LIBDBI="#LIBDBI" + else + if test "$CATALOG" = "mysql" ; then + DBPORT=3306 + else + DBPORT=5432 + fi + + _WHICHDB="WHICHDB=\"--disable-nls --with-dbi --with-dbi-driver=${CATALOG} ${ENABLE_BATCH_INSERT} --with-db-port=${DBPORT}\"" + _LIBDBI="LIBDBI=\"dbdriver = dbi:${CATALOG}; dbaddress = 127.0.0.1; dbport = ${DBPORT}\"" + + fi + + _SITE_NAME="SITE_NAME=joaohf-bacula-${CT}" + + # subustitute config values + cp -a ${PWD}/config ${PWD}/config.tmp + + mkdir -p tmp + + echo "/^SITE_NAME/c $_SITE_NAME" >> tmp/config_sed + echo "/^WHICHDB/c $_WHICHDB" >> tmp/config_sed + echo "/^#LIBDBI/c $_LIBDBI" >> tmp/config_sed + echo "/^LIBDBI/c $_LIBDBI" >> tmp/config_sed + + sed -f tmp/config_sed ${PWD}/config.tmp > ${PWD}/config + rm tmp/config_sed + + make setup + ./experimental-disk + echo " ==== Submiting ${_SITE_NAME} ====" >> test.out +done + + + +