From 3f65ac4d3f3132d4e217bafbe9df843f43cf37ce Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 19 Jun 2008 19:12:05 +0000 Subject: [PATCH] Add configured db user,name,password to bscan tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7182 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/scripts/functions | 4 ++++ regress/tests/bscan-tape | 12 ++++++++++-- regress/tests/bscan-test | 11 +++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/regress/scripts/functions b/regress/scripts/functions index 46c2876fcc..50c92e0c3b 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -283,5 +283,9 @@ fi # Source the configuration variables . ${cwd}/config +db_name=${db_name:-"regress"} +db_user=${db_user:-"regress"} +db_password=${db_password:-""} + CLIENT=${HOST}-fd AUTOCHANGER_SCRIPT=${AUTOCHANGER_SCRIPT:-mtx-changer} diff --git a/regress/tests/bscan-tape b/regress/tests/bscan-tape index 71341697e4..17655610db 100755 --- a/regress/tests/bscan-tape +++ b/regress/tests/bscan-tape @@ -95,10 +95,18 @@ cd bin cd .. echo "volume=TestVolume001" >tmp/bscan.bsr + +# If the database has a password pass it to bscan +if test "x${db_passwd}" = "x"; then + PASSWD= +else + PASSWD="-P ${db_passwd}" +fi + if test "$debug" -eq 1 ; then - bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 + bin/bscan -w working -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 else - bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null + bin/bscan -w working -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null fi cat <tmp/bconcmds diff --git a/regress/tests/bscan-test b/regress/tests/bscan-test index fd71ef336d..431e6648e5 100755 --- a/regress/tests/bscan-test +++ b/regress/tests/bscan-test @@ -57,10 +57,17 @@ stop_bacula echo "volume=TestVolume001" >tmp/bscan.bsr echo "volume=TestVolume002" >>tmp/bscan.bsr +# If the database has a password pass it to bscan +if test "x${db_passwd}" = "x"; then + PASSWD= +else + PASSWD="-P ${db_passwd}" +fi + if test "$debug" -eq 1 ; then - bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp + bin/bscan -w working -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp else - bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >tmp/log3.out + bin/bscan -w working -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >tmp/log3.out fi cat <tmp/bconcmds -- 2.39.5