]> git.sur5r.net Git - bacula/bacula/commitdiff
Add configured user,name,password to bscan tests
authorKern Sibbald <kern@sibbald.com>
Thu, 19 Jun 2008 19:11:38 +0000 (19:11 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 19 Jun 2008 19:11:38 +0000 (19:11 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7181 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/functions
regress/tests/bscan-tape
regress/tests/bscan-test

index 6aad47dca10502e760f12ce15785e76baf8b4c87..b76f70f5b004558543f14296bc4e05263239a176 100644 (file)
@@ -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}
index 0982d89d00e626bd7da5c11baf276537b4e35322..f75fa9d91264761a107e78a8c5b300ec8e1a0d82 100755 (executable)
@@ -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
index 9a158974f974896dcf8438ad96f5f5077f66e4fb..b39a242f4edb4c0f97a3124da24d77cd1b9fb537 100755 (executable)
@@ -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 <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null