From: Kern Sibbald Date: Thu, 19 Jun 2008 19:11:38 +0000 (+0000) Subject: Add configured user,name,password to bscan tests X-Git-Tag: Release-3.0.0~1277 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5edebcd5597e3cacb9ff18376ffdd345eea46192;p=bacula%2Fbacula Add configured user,name,password to bscan tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7181 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/functions b/regress/scripts/functions index 6aad47dca1..b76f70f5b0 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -304,5 +304,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 0982d89d00..f75fa9d912 100755 --- a/regress/tests/bscan-tape +++ b/regress/tests/bscan-tape @@ -98,10 +98,17 @@ echo "volume=TestVolume001" >tmp/bscan.bsr bscan_libdbi +# 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 $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 + bin/bscan -w working $BSCANLIBDBI -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 $BSCANLIBDBI -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 $BSCANLIBDBI -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 echo $BSCANLIBDBI diff --git a/regress/tests/bscan-test b/regress/tests/bscan-test index 9a158974f9..b39a242f4e 100755 --- a/regress/tests/bscan-test +++ b/regress/tests/bscan-test @@ -59,13 +59,18 @@ echo "volume=TestVolume002" >>tmp/bscan.bsr bscan_libdbi -if test "$debug" -eq 1 ; then - bin/bscan -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp +# If the database has a password pass it to bscan +if test "x${db_passwd}" = "x"; then + PASSWD= else - bin/bscan -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >tmp/log3.out + PASSWD="-P ${db_passwd}" fi - +if test "$debug" -eq 1 ; then + bin/bscan -w working $BSCANLIBDBI -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 $BSCANLIBDBI -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 @$out /dev/null