From 8f8d4cf84905f93ca58d41b0b09a2ecb33a18ada Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 11 Jun 2008 08:07:49 +0000 Subject: [PATCH] Apply patch from Thomas Mueller that adds db parameters to config file git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7127 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/prototype.conf | 5 ++++ regress/scripts/bacula-dir-2client.conf.in | 2 +- regress/scripts/bacula-dir-2d.conf.in | 2 +- regress/scripts/bacula-dir-fifo.conf.in | 2 +- regress/scripts/bacula-dir-migration.conf.in | 2 +- regress/scripts/bacula-dir-strip.conf.in | 2 +- regress/scripts/bacula-dir-tape.conf.in | 2 +- regress/scripts/bacula-dir-vtape.conf.in | 2 +- regress/scripts/bacula-dir-win32-tape.conf.in | 2 +- regress/scripts/bacula-dir.conf.accurate.in | 2 +- regress/scripts/bacula-dir.conf.errors.in | 2 +- regress/scripts/bacula-dir.conf.maxtime.in | 2 +- regress/scripts/bacula-dir.conf.regexwhere.in | 2 +- .../scripts/bacula-dir.conf.testrunscript.in | 2 +- regress/scripts/create_sed | 8 ++++- regress/scripts/do_sed | 2 ++ .../scripts/multi-client-bacula-dir.conf.in | 2 +- regress/scripts/new-test-bacula-dir.conf.in | 2 +- regress/scripts/regress-config | 29 +++++++++++++++++++ regress/scripts/test-bacula-dir.conf.in | 2 +- regress/scripts/testa-bacula-dir.conf.in | 2 +- regress/scripts/testb-bacula-dir.conf.in | 2 +- regress/scripts/tls-auth-bacula-dir.conf.in | 2 +- regress/scripts/tls-bacula-dir.conf.in | 2 +- regress/scripts/win32-bacula-dir-tape.conf.in | 2 +- regress/scripts/win32-bacula-dir.conf.in | 2 +- 26 files changed, 65 insertions(+), 23 deletions(-) diff --git a/regress/prototype.conf b/regress/prototype.conf index 5af6ba96f4..47c14d5548 100644 --- a/regress/prototype.conf +++ b/regress/prototype.conf @@ -47,6 +47,11 @@ AUTOCHANGER_PATH="/usr/sbin/mtx" #WHICHDB="--with-postgresql" WHICHDB="--with-mysql" +# DB parameters +db_name="regress" +db_user="regress" +db_password= + # Set this if you use libdbi framework #LIBDBI="dbdriver = "dbi:postgresql"; dbaddress = 127.0.0.1; dbport = 5432" diff --git a/regress/scripts/bacula-dir-2client.conf.in b/regress/scripts/bacula-dir-2client.conf.in index 05bfa5b38e..636cfaa43e 100644 --- a/regress/scripts/bacula-dir-2client.conf.in +++ b/regress/scripts/bacula-dir-2client.conf.in @@ -233,7 +233,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/bacula-dir-2d.conf.in b/regress/scripts/bacula-dir-2d.conf.in index 0fee4369db..8a4080bff8 100644 --- a/regress/scripts/bacula-dir-2d.conf.in +++ b/regress/scripts/bacula-dir-2d.conf.in @@ -114,7 +114,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/bacula-dir-fifo.conf.in b/regress/scripts/bacula-dir-fifo.conf.in index edc1233c97..8da99203d4 100644 --- a/regress/scripts/bacula-dir-fifo.conf.in +++ b/regress/scripts/bacula-dir-fifo.conf.in @@ -162,7 +162,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/bacula-dir-migration.conf.in b/regress/scripts/bacula-dir-migration.conf.in index 702cdd9556..9f25ac994b 100644 --- a/regress/scripts/bacula-dir-migration.conf.in +++ b/regress/scripts/bacula-dir-migration.conf.in @@ -175,7 +175,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/bacula-dir-strip.conf.in b/regress/scripts/bacula-dir-strip.conf.in index 9dcc243ef4..46e89dd6a5 100644 --- a/regress/scripts/bacula-dir-strip.conf.in +++ b/regress/scripts/bacula-dir-strip.conf.in @@ -168,7 +168,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/bacula-dir-tape.conf.in b/regress/scripts/bacula-dir-tape.conf.in index dd192c68a6..5a581bbb8e 100644 --- a/regress/scripts/bacula-dir-tape.conf.in +++ b/regress/scripts/bacula-dir-tape.conf.in @@ -202,7 +202,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/bacula-dir-vtape.conf.in b/regress/scripts/bacula-dir-vtape.conf.in index fb1f4011f1..118f496739 100644 --- a/regress/scripts/bacula-dir-vtape.conf.in +++ b/regress/scripts/bacula-dir-vtape.conf.in @@ -306,7 +306,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/bacula-dir-win32-tape.conf.in b/regress/scripts/bacula-dir-win32-tape.conf.in index f4d572ef6b..082e7ecbf3 100644 --- a/regress/scripts/bacula-dir-win32-tape.conf.in +++ b/regress/scripts/bacula-dir-win32-tape.conf.in @@ -104,7 +104,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/bacula-dir.conf.accurate.in b/regress/scripts/bacula-dir.conf.accurate.in index 5b145a9e64..1f6d99f4ce 100644 --- a/regress/scripts/bacula-dir.conf.accurate.in +++ b/regress/scripts/bacula-dir.conf.accurate.in @@ -123,7 +123,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } diff --git a/regress/scripts/bacula-dir.conf.errors.in b/regress/scripts/bacula-dir.conf.errors.in index eb84eba847..5e57e3c7cf 100644 --- a/regress/scripts/bacula-dir.conf.errors.in +++ b/regress/scripts/bacula-dir.conf.errors.in @@ -205,7 +205,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } diff --git a/regress/scripts/bacula-dir.conf.maxtime.in b/regress/scripts/bacula-dir.conf.maxtime.in index 21e0f522db..5f9d1da94d 100644 --- a/regress/scripts/bacula-dir.conf.maxtime.in +++ b/regress/scripts/bacula-dir.conf.maxtime.in @@ -108,7 +108,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } diff --git a/regress/scripts/bacula-dir.conf.regexwhere.in b/regress/scripts/bacula-dir.conf.regexwhere.in index a67b71301a..d1af63cefc 100644 --- a/regress/scripts/bacula-dir.conf.regexwhere.in +++ b/regress/scripts/bacula-dir.conf.regexwhere.in @@ -118,7 +118,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } diff --git a/regress/scripts/bacula-dir.conf.testrunscript.in b/regress/scripts/bacula-dir.conf.testrunscript.in index 34540bd167..617ab8ca17 100644 --- a/regress/scripts/bacula-dir.conf.testrunscript.in +++ b/regress/scripts/bacula-dir.conf.testrunscript.in @@ -228,7 +228,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } diff --git a/regress/scripts/create_sed b/regress/scripts/create_sed index 46475e3a29..350a31a2ea 100755 --- a/regress/scripts/create_sed +++ b/regress/scripts/create_sed @@ -8,7 +8,7 @@ mkdir -p ${cwd}/bin mkdir -p ${cwd}/tmp out="${cwd}/tmp/sed_tmp" -# set the ports used by these tests +# set ports and other default parameters BASEPORT=${BASEPORT:-8101} AUTOCHANGER_SCRIPT=${AUTOCHANGER_SCRIPT:-mtx-changer} LIBDBI=${LIBDBI:-} @@ -17,6 +17,9 @@ srcdir=${BACULA_SOURCE} dirport=${BASEPORT} fdport=`expr ${BASEPORT} '+' 1` sdport=`expr ${BASEPORT} '+' 2` +db_name=${db_name:-"regress"} +db_user=${db_user:-"regress"} +db_password=${db_password:-""} os=`uname -s`-`./scripts/get-os` dbengine=`echo ${WHICHDB} | sed -e 's/--with-//' -e 's/=.*//'` bversion=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` @@ -65,3 +68,6 @@ echo "s%@win32_addr@%${WIN32_ADDR}%g" >>${out} echo "s%@win32_file@%${WIN32_FILE}%g" >>${out} echo "s%@win32_port@%${WIN32_PORT}%g" >>${out} echo "s%@win32_password@%${WIN32_PASSWORD}%g" >>${out} +echo "s%@db_name@%${db_name}%g" >>${out} +echo "s%@db_user@%${db_user}%g" >>${out} +echo "s%@db_password@%${db_password}%g" >>${out} diff --git a/regress/scripts/do_sed b/regress/scripts/do_sed index b23e054249..ab5e7ed27d 100755 --- a/regress/scripts/do_sed +++ b/regress/scripts/do_sed @@ -57,6 +57,8 @@ sed -f ${out} ${cwd}/scripts/bacula-fd-2d.conf.in >${cwd}/scripts/bacula-fd-2d.c 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 + scripts/config_dart diff --git a/regress/scripts/multi-client-bacula-dir.conf.in b/regress/scripts/multi-client-bacula-dir.conf.in index 59e97eeca2..fad158694e 100644 --- a/regress/scripts/multi-client-bacula-dir.conf.in +++ b/regress/scripts/multi-client-bacula-dir.conf.in @@ -325,7 +325,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/new-test-bacula-dir.conf.in b/regress/scripts/new-test-bacula-dir.conf.in index 38ce5586e3..af69036150 100644 --- a/regress/scripts/new-test-bacula-dir.conf.in +++ b/regress/scripts/new-test-bacula-dir.conf.in @@ -440,7 +440,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/regress-config b/regress/scripts/regress-config index 5b589bd68f..b6cb8bd2bf 100755 --- a/regress/scripts/regress-config +++ b/regress/scripts/regress-config @@ -27,3 +27,32 @@ CFLAGS="-g -O2 -Wall" \ --with-baseport=${BASEPORT} exit 0 +#!/bin/sh +# +# This is the configuration script for regression testing +# + +. ${1}/config + +CFLAGS="-g -O2 -Wall" \ + ./configure \ + --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-archivedir=${1}/tmp \ + --with-dump-email=${EMAIL} \ + --with-job-email=${EMAIL} \ + --with-smtp-host=${SMTP_HOST} \ + --with-db-name=regress \ + --with-db-user=regress \ + ${OPENSSL} \ + ${TCPWRAPPERS} \ + ${WHICHDB} \ + --with-baseport=${BASEPORT} + +exit 0 diff --git a/regress/scripts/test-bacula-dir.conf.in b/regress/scripts/test-bacula-dir.conf.in index e1fe75e18d..69833a4374 100644 --- a/regress/scripts/test-bacula-dir.conf.in +++ b/regress/scripts/test-bacula-dir.conf.in @@ -261,7 +261,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/testa-bacula-dir.conf.in b/regress/scripts/testa-bacula-dir.conf.in index 4741e76829..cd956931f2 100644 --- a/regress/scripts/testa-bacula-dir.conf.in +++ b/regress/scripts/testa-bacula-dir.conf.in @@ -103,7 +103,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/testb-bacula-dir.conf.in b/regress/scripts/testb-bacula-dir.conf.in index 5c9d838d19..e85afacb75 100644 --- a/regress/scripts/testb-bacula-dir.conf.in +++ b/regress/scripts/testb-bacula-dir.conf.in @@ -107,7 +107,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/tls-auth-bacula-dir.conf.in b/regress/scripts/tls-auth-bacula-dir.conf.in index fcdfeb535b..01aee907c6 100644 --- a/regress/scripts/tls-auth-bacula-dir.conf.in +++ b/regress/scripts/tls-auth-bacula-dir.conf.in @@ -339,7 +339,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/tls-bacula-dir.conf.in b/regress/scripts/tls-bacula-dir.conf.in index aebf2b63b5..bd6c965a25 100644 --- a/regress/scripts/tls-bacula-dir.conf.in +++ b/regress/scripts/tls-bacula-dir.conf.in @@ -336,7 +336,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/win32-bacula-dir-tape.conf.in b/regress/scripts/win32-bacula-dir-tape.conf.in index 00a9364bb4..be11cb6355 100644 --- a/regress/scripts/win32-bacula-dir-tape.conf.in +++ b/regress/scripts/win32-bacula-dir-tape.conf.in @@ -118,7 +118,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address diff --git a/regress/scripts/win32-bacula-dir.conf.in b/regress/scripts/win32-bacula-dir.conf.in index e605eac446..4b8e901da6 100644 --- a/regress/scripts/win32-bacula-dir.conf.in +++ b/regress/scripts/win32-bacula-dir.conf.in @@ -118,7 +118,7 @@ Storage { Catalog { Name = MyCatalog @libdbi@ - dbname = regress; user = regress; password = "" + dbname = @db_name@; user = @db_user@; password = "@db_password@" } # Reasonable message delivery -- send most everything to email address -- 2.39.5