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

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

index 46c2876fcc075408c37d6f52f04b3e5ab35eb79f..50c92e0c3b52e4b77a0e7f8b562511f243526c11 100644 (file)
@@ -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}
index 71341697e491e81b2b39f42cc0ddb09681dfb5bc..17655610db3b9796d96f856ae53f7fcf84bc513b 100755 (executable)
@@ -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 <<END_OF_DATA >tmp/bconcmds
index fd71ef336daed3acf591e86d3b7612470fd48767..431e6648e5455106177b693bbab064271f2624ae 100755 (executable)
@@ -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 <<END_OF_DATA >tmp/bconcmds