From: Eric Bollengier Date: Tue, 9 Dec 2008 13:21:40 +0000 (+0000) Subject: ebl Tweak regress scripts to be able to test distro binaries X-Git-Tag: Release-7.0.0~3663 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a86a8b4b073337f6c23084233fa3ae49a7ef7663;p=bacula%2Fbacula ebl Tweak regress scripts to be able to test distro binaries git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8129 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/check_for_zombie_jobs b/regress/scripts/check_for_zombie_jobs index b1f689ee20..62ba3bece6 100755 --- a/regress/scripts/check_for_zombie_jobs +++ b/regress/scripts/check_for_zombie_jobs @@ -14,7 +14,7 @@ else client=${HOST}-fd fi -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null +$bin/bconsole -c bin/bconsole.conf <&1 >/dev/null @output tmp/dir.out status dir @output tmp/fd.out diff --git a/regress/scripts/cleanup-2drive.in b/regress/scripts/cleanup-2drive.in index e6fa40e997..a0fbd6b08e 100755 --- a/regress/scripts/cleanup-2drive.in +++ b/regress/scripts/cleanup-2drive.in @@ -6,40 +6,40 @@ scripts/cleanup if test x@autochanger@ != x/dev/null; then - slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive1@ 1` + slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive1@ 1` echo "Slot $slot in drive 1" if test x$slot != x0 ; then echo "unload slot $slot in drive 1" - bin/@changer_script@ @autochanger@ unload $slot @tape_drive1@ 1 + $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive1@ 1 fi - slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ 0` + slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive@ 0` echo "Slot $slot in drive 0" if test x$slot != x0 ; then echo "unload slot $slot in drive 0" - bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ 0 + $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ 0 fi - slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive1@ 1` + slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive1@ 1` if test x$slot != x$SLOT2; then echo "load slot $SLOT2 in drive 1" - bin/@changer_script@ @autochanger@ load $SLOT2 @tape_drive1@ 1 + $scripts/@changer_script@ @autochanger@ load $SLOT2 @tape_drive1@ 1 fi echo "WEOF drive 1" init_drive @tape_drive1@ echo "unload slot $SLOT2 in drive 1" - bin/@changer_script@ @autochanger@ unload $SLOT2 @tape_drive1@ 1 + $scripts/@changer_script@ @autochanger@ unload $SLOT2 @tape_drive1@ 1 - slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ 0` + slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive@ 0` echo "Slot $slot in drive 0" if test x$slot != x$SLOT1; then echo "load slot $SLOT1 in drive 0" - bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ 0 + $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ 0 fi echo "WEOF drive 0" init_drive @tape_drive@ echo "unload slot $SLOT1 from drive 0" - bin/@changer_script@ @autochanger@ unload $SLOT1 @tape_drive@ 0 + $scripts/@changer_script@ @autochanger@ unload $SLOT1 @tape_drive@ 0 fi diff --git a/regress/scripts/cleanup-tape.in b/regress/scripts/cleanup-tape.in index 86c3a198de..e08b12a854 100755 --- a/regress/scripts/cleanup-tape.in +++ b/regress/scripts/cleanup-tape.in @@ -12,16 +12,16 @@ scripts/cleanup init_slot @tape_drive@ $SLOT1 if test x@autochanger@ != x/dev/null; then - slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1` + slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1` case $slot in 0) - bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 ;; $SLOT1) ;; *) - bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1 - bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 ;; esac fi diff --git a/regress/scripts/functions b/regress/scripts/functions index ef0e72e3f8..940b3dd1e0 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -10,11 +10,11 @@ start_test() echo "s% mail =%# mail = %g" >${outf} echo "s% operator =%# operator =%g" >>${outf} cp bin/bacula-dir.conf tmp/1 - sed -f ${outf} tmp/1 >bin/bacula-dir.conf + sed -f ${outf} tmp/1 > bin/bacula-dir.conf echo " " echo " " echo " === Starting $TestName at `date +%R:%S` ===" - echo " === Starting $TestName at `date +%R:%S` ===" >>working/log + echo " === Starting $TestName at `date +%R:%S` ===" >> working/log echo " " export zstat } @@ -147,11 +147,11 @@ run_bacula() bin/bacula-ctl-sd start bin/bacula-ctl-fd start $1 bin/bacula-ctl-dir start - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf + cat tmp/bconcmds | $bin/bconsole -c bin/bconsole.conf return $? else - bin/bacula start 2>&1 >/dev/null - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null + bin/bacula start >/dev/null 2>&1 + cat tmp/bconcmds | $bin/bconsole -c bin/bconsole.conf >/dev/null 2>&1 return $? fi } @@ -159,27 +159,27 @@ run_bacula() run_bconsole() { if test "$debug" -eq 1 ; then - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf + cat tmp/bconcmds | $bin/bconsole -c bin/bconsole.conf else - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null + cat tmp/bconcmds | $bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null fi } run_btape() { if test "$debug" -eq 1 ; then - cat tmp/bconcmds | bin/btape -c bin/bacula-sd.conf DDS-4 | tee tmp/log1.out + cat tmp/bconcmds | $bin/btape -c bin/bacula-sd.conf DDS-4 | tee tmp/log1.out else - cat tmp/bconcmds | bin/btape -c bin/bacula-sd.conf DDS-4 2>&1 >tmp/log1.out + cat tmp/bconcmds | $bin/btape -c bin/bacula-sd.conf DDS-4 >tmp/log1.out 2>&1 fi } run_bscan() { if test "$debug" -eq 1 ; then - bin/bscan $* | tee tmp/log.out + $bin/bscan $* | tee tmp/log.out else - bin/bscan $* 2>&1 >/dev/null + $bin/bscan $* 2>&1 >/dev/null fi } @@ -356,10 +356,10 @@ rewind_drive() load_slot1() { # Get a tape from slot1 -slot=`bin/$MTX ${AUTOCHANGER} loaded 0 ${TAPE_DRIVE} $DRIVE1` +slot=`$scripts/$MTX ${AUTOCHANGER} loaded 0 ${TAPE_DRIVE} $DRIVE1` case $slot in 0) - bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 + $scripts/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 slot=$SLOT1 ;; $SLOT1) @@ -367,8 +367,8 @@ case $slot in ;; *) rewind_drive ${TAPE_DRIVE} - bin/$MTX ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1 - bin/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 + $scripts/$MTX ${AUTOCHANGER} unload $slot ${TAPE_DRIVE} $DRIVE1 + $scripts/$MTX ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 slot=$SLOT1 ;; esac @@ -383,17 +383,17 @@ load_other_slot() rewind_drive ${TAPE_DRIVE} case $1 in 0) - bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 + $scripts/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 slot=1 ;; $SLOT1) - bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} unload $1 ${TAPE_DRIVE} $DRIVE1 - bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT2 ${TAPE_DRIVE} $DRIVE1 + $scripts/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} unload $1 ${TAPE_DRIVE} $DRIVE1 + $scripts/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT2 ${TAPE_DRIVE} $DRIVE1 slot=2 ;; $SLOT2) - bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} unload $1 ${TAPE_DRIVE} $DRIVE1 - bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 + $scripts/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} unload $1 ${TAPE_DRIVE} $DRIVE1 + $scripts/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} load $SLOT1 ${TAPE_DRIVE} $DRIVE1 slot=1 ;; *) @@ -403,7 +403,6 @@ case $1 in esac } - # Save current directory cwd=`pwd` if test "x${REGRESS_DEBUG}" = "x1"; then @@ -418,16 +417,23 @@ fi db_name=${db_name:-"regress"} db_user=${db_user:-"regress"} db_password=${db_password:-""} +working=${working:-"$cwd/working"} +bin=${bin:-"$cwd/bin"} +scripts=${scripts:-"$bin"} + +export bin +export working +export scripts CLIENT=${HOST}-fd if [ x$USE_VTAPE = xyes ]; then - mkdir -p $cwd/working/ach + mkdir -p $working/ach SLOT1=1 SLOT2=2 - TAPE_DRIVE=$cwd/working/ach/drive1 - TAPE_DRIVE1=$cwd/working/ach/drive1 - AUTOCHANGER=$cwd/working/ach/config + TAPE_DRIVE=$working/ach/drive1 + TAPE_DRIVE1=$working/ach/drive1 + AUTOCHANGER=$working/ach/config AUTOCHANGER_SCRIPT=disk-changer DRIVE1=0 DRIVE2=1 @@ -438,6 +444,6 @@ EOF fi AUTOCHANGER_SCRIPT=${AUTOCHANGER_SCRIPT:-mtx-changer} -LD_LIBRARY_PATH=$cwd/bin:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$bin:$LD_LIBRARY_PATH export LD_LIBRARY_PATH diff --git a/regress/scripts/prepare-two-tapes.in b/regress/scripts/prepare-two-tapes.in index 1093895ab7..5d06bdca46 100755 --- a/regress/scripts/prepare-two-tapes.in +++ b/regress/scripts/prepare-two-tapes.in @@ -18,10 +18,10 @@ init_slot @tape_drive@ $SLOT2 # optimize so we don't unnecessarily unload and load slots # if test x@autochanger@ != x/dev/null; then - slot=`bin/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1` + slot=`$scripts/@changer_script@ @autochanger@ loaded 0 @tape_drive@ $DRIVE1` case $slot in 0) - bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 slot=$SLOT1 ;; $SLOT1) @@ -31,22 +31,22 @@ if test x@autochanger@ != x/dev/null; then slot=$SLOT2 ;; *) - bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1 - bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 slot=$SLOT1 ;; esac init_drive @tape_drive@ - bin/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ unload $slot @tape_drive@ $DRIVE1 # init the other slot case $slot in $SLOT1) - bin/@changer_script@ @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ load $SLOT2 @tape_drive@ $DRIVE1 ;; $SLOT2) - bin/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 + $scripts/@changer_script@ @autochanger@ load $SLOT1 @tape_drive@ $DRIVE1 ;; *) echo "Something went wrong. Expected $SLOT1 or $SLOT2, got $slot" diff --git a/regress/scripts/setup b/regress/scripts/setup index 4a6e81b2c9..cf0c2ddfb0 100755 --- a/regress/scripts/setup +++ b/regress/scripts/setup @@ -20,6 +20,7 @@ if [ ! -d ${BACULA_SOURCE} ] ; then exit 1 fi +# we build and setup binaries to the $cwd/bin directory not $bin rm -rf build bin # Copy new source echo "Copying source from ${BACULA_SOURCE}" diff --git a/regress/tests/accurate-test b/regress/tests/accurate-test index aac9861af8..4ae2b1e66c 100755 --- a/regress/tests/accurate-test +++ b/regress/tests/accurate-test @@ -164,7 +164,7 @@ rm -rf ${cwd}/tmp/bacula-restores p Check with bls ################################################################ -${cwd}/bin/bls -c ${cwd}/bin/bacula-sd.conf -V 'TestVolume001' FileStorage > tmp/bls.out +$bin/bls -c bin/bacula-sd.conf -V 'TestVolume001' FileStorage > tmp/bls.out grep -- '----' tmp/bls.out | grep xxx > /dev/null if [ $? != 0 ] ; then bstat=2 @@ -290,7 +290,7 @@ echo "volume=TestVolume001" >tmp/bscan.bsr bscan_libdbi -${cwd}/bin/bscan -c ${cwd}/bin/bacula-sd.conf $BSCANLIBDBI -n regress -u regress -m -s -b tmp/bscan.bsr FileStorage 2>&1 > ${cwd}/tmp/bscan.log +$bin/bscan -c bin/bacula-sd.conf $BSCANLIBDBI -n regress -u regress -m -s -b tmp/bscan.bsr FileStorage 2>&1 > ${cwd}/tmp/bscan.log cat <${cwd}/tmp/bconcmds @$out ${cwd}/tmp/log1.out diff --git a/regress/tests/bextract-test b/regress/tests/bextract-test index 0446bf7a7f..32dafd3b30 100755 --- a/regress/tests/bextract-test +++ b/regress/tests/bextract-test @@ -45,9 +45,9 @@ stop_bacula mkdir -p ${cwd}/tmp/bacula-restores if test "$debug" -eq 1 ; then - bin/bextract -v -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores + $bin/bextract -v -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores else - bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null + $bin/bextract -b working/restore.bsr -c bin/bacula-sd.conf ${cwd}/tmp ${cwd}/tmp/bacula-restores 2>&1 >/dev/null fi rstat=$? grep "^ Termination: *Backup OK" ${cwd}/tmp/log1.out 2>&1 >/dev/null diff --git a/regress/tests/bscan-fast-tape b/regress/tests/bscan-fast-tape index a6ba184c53..60affd3f66 100755 --- a/regress/tests/bscan-fast-tape +++ b/regress/tests/bscan-fast-tape @@ -34,7 +34,7 @@ quit END_OF_DATA echo "Starting Bacula tape writing" -#bin/btape -c bin/bacula-sd.conf /dev/nst0 <tmp/bscan.bsr bscan_libdbi -strace -o strace.new bin/bscan -d200 -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 +strace -o strace.new $bin/bscan -d200 -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 exit cat <tmp/bconcmds @$out /dev/null diff --git a/regress/tests/bscan-tape b/regress/tests/bscan-tape index 3cbcb37362..8c98c1e3e7 100755 --- a/regress/tests/bscan-tape +++ b/regress/tests/bscan-tape @@ -106,9 +106,9 @@ else 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 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 ${db_user} -n ${db_name} $PASSWD -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 >/dev/null 2>&1 fi echo $BSCANLIBDBI diff --git a/regress/tests/bscan-test b/regress/tests/bscan-test index 92f8ec6229..20ac940a3e 100755 --- a/regress/tests/bscan-test +++ b/regress/tests/bscan-test @@ -67,9 +67,9 @@ else 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 + $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 + $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 >tmp/log3.out 2>&1 fi cat <tmp/bconcmds diff --git a/regress/tests/btape-fill-full-tape b/regress/tests/btape-fill-full-tape index dc3fcec98c..6c34094ab8 100755 --- a/regress/tests/btape-fill-full-tape +++ b/regress/tests/btape-fill-full-tape @@ -14,7 +14,7 @@ scripts/cleanup-tape change_jobname $JobName start_test -bin/btape -c bin/bacula-sd.conf DDS-4 <&1 >${cwd}/tmp/log1.out +$bin/btape -c bin/bacula-sd.conf DDS-4 <${cwd}/tmp/log1.out 2>&1 fill s @@ -22,7 +22,7 @@ quit END_OF_DATA -grep "^The last block on the tape matches\. Test succeeded\." ${cwd}/tmp/log1.out 2>&1 >/dev/null +grep "^The last block on the tape matches\. Test succeeded\." ${cwd}/tmp/log1.out >/dev/null 2>&1 if [ $? != 0 ] ; then echo " " echo " " diff --git a/regress/tests/bug-fatal-test b/regress/tests/bug-fatal-test index 249858d6fb..0677657810 100755 --- a/regress/tests/bug-fatal-test +++ b/regress/tests/bug-fatal-test @@ -34,12 +34,11 @@ quit END_OF_DATA -bin/bacula start -cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf > /dev/null +run_bacula stop_bacula -export dstat=0 -export bstat=0 -export rstat=0 +dstat=0 +bstat=0 +rstat=0 end_test diff --git a/regress/tests/concurrent-jobs-test b/regress/tests/concurrent-jobs-test index 37c69bd801..8726113f27 100755 --- a/regress/tests/concurrent-jobs-test +++ b/regress/tests/concurrent-jobs-test @@ -16,7 +16,7 @@ if test -c /dev/urandom ; then dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000 else echo "Creating a 56MB file with bacula-dir data ..." - dd if=bin/bacula-dir of=${cwd}/tmp/1 bs=1024 count=1000 + dd if=$bin/bacula-dir of=${cwd}/tmp/1 bs=1024 count=1000 cat ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 >${cwd}/tmp/2 rm -f ${cwd}/tmp/1 cat ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 >>${cwd}/tmp/3 diff --git a/regress/tests/disk-changer-test b/regress/tests/disk-changer-test index c0c0eec8c7..b497098e23 100755 --- a/regress/tests/disk-changer-test +++ b/regress/tests/disk-changer-test @@ -3,43 +3,43 @@ rm -rf tmp/disk-changer mkdir tmp/disk-changer touch tmp/disk-changer/conf echo "Unload drive 0" -bin/disk-changer tmp/disk-changer/conf unload 1 tmp/disk-changer/drive0 0 +$scripts/disk-changer tmp/disk-changer/conf unload 1 tmp/disk-changer/drive0 0 echo "rtn=$?" echo "Test what is in drive 0" -bin/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive0 0 +$scripts/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive0 0 echo "rtn=$?" echo "Load Slot 1 into drive 0" -bin/disk-changer tmp/disk-changer/conf load 1 tmp/disk-changer/drive0 0 +$scripts/disk-changer tmp/disk-changer/conf load 1 tmp/disk-changer/drive0 0 echo "rtn=$?" echo "Test what is in drive 0" -bin/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive0 0 +$scripts/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive0 0 echo "rtn=$?" echo "Unload drive 1" -bin/disk-changer tmp/disk-changer/conf unload 2 tmp/disk-changer/drive1 1 +$scripts/disk-changer tmp/disk-changer/conf unload 2 tmp/disk-changer/drive1 1 echo "rtn=$?" echo "Test what is in drive 1" -bin/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive1 1 +$scripts/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive1 1 echo "rtn=$?" echo "Load Slot 2 drive 1" -bin/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive1 1 +$scripts/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive1 1 echo "rtn=$?" echo "Test what is in drive 1" -bin/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive1 1 +$scripts/disk-changer tmp/disk-changer/conf loaded 1 tmp/disk-changer/drive1 1 echo "rtn=$?" echo "Load Slot 1 into drive 0 -- error" -bin/disk-changer tmp/disk-changer/conf load 1 tmp/disk-changer/drive0 0 +$scripts/disk-changer tmp/disk-changer/conf load 1 tmp/disk-changer/drive0 0 echo "rtn=$?" echo "Load Slot 2 into drive 1 -- error" -bin/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive1 1 +$scripts/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive1 1 echo "rtn=$?" echo "Load Slot 2 in drive 0 -- error" -bin/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive0 0 +$scripts/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive0 0 echo "rtn=$?" echo "Unload drive 0" -bin/disk-changer tmp/disk-changer/conf unload 1 tmp/disk-changer/drive0 0 +$scripts/disk-changer tmp/disk-changer/conf unload 1 tmp/disk-changer/drive0 0 echo "rtn=$?" echo "Load Slot 2 in drive 0 -- should fail" -bin/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive0 0 +$scripts/disk-changer tmp/disk-changer/conf load 2 tmp/disk-changer/drive0 0 echo "rtn=$?" diff --git a/regress/tests/errors-test b/regress/tests/errors-test index 5bd40fcb49..5a57c42350 100755 --- a/regress/tests/errors-test +++ b/regress/tests/errors-test @@ -64,7 +64,7 @@ END_OF_DATA run_bacula touch ${cwd}/tmp/log1.out -client=$(grep client= bin/bacula-dir.conf) +client=`grep client= $bin/bacula-dir.conf` check_for_zombie_jobs storage=File $client stop_bacula diff --git a/regress/tests/four-jobs-tape b/regress/tests/four-jobs-tape index ff579c09a0..e3505277da 100755 --- a/regress/tests/four-jobs-tape +++ b/regress/tests/four-jobs-tape @@ -30,13 +30,7 @@ wait messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - bin/bacula start - cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - bin/bacula start 2>&1 >/dev/null - cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi +run_bacula scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 1 done" @@ -56,13 +50,8 @@ wait messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - bin/bacula start - cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - bin/bacula start 2>&1 >/dev/null - cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi + +run_bacula scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 2 done" @@ -80,13 +69,8 @@ wait messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - bin/bacula start - cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - bin/bacula start 2>&1 >/dev/null - cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi + +run_bacula scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 3 done" @@ -104,13 +88,7 @@ wait messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - bin/bacula start - cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - bin/bacula start 2>&1 >/dev/null - cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi +run_bacula scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 4 done" diff --git a/regress/tests/incremental-2disk b/regress/tests/incremental-2disk index 1c1efb4c00..48b36ce721 100755 --- a/regress/tests/incremental-2disk +++ b/regress/tests/incremental-2disk @@ -9,14 +9,7 @@ TestName="incremental-2disk" JobName=Inc2disk . scripts/functions - -stop_bacula -cd bin -./drop_bacula_tables >/dev/null 2>&1 -./make_bacula_tables >/dev/null 2>&1 -./grant_bacula_privileges 2>&1 >/dev/null -cd .. - +scripts/cleanup scripts/copy-2disk-confs scripts/prepare-disk-changer diff --git a/regress/tests/lib-tape-root b/regress/tests/lib-tape-root index b02c15284f..9044d1c088 100755 --- a/regress/tests/lib-tape-root +++ b/regress/tests/lib-tape-root @@ -5,13 +5,7 @@ # cwd=`pwd` . scripts/functions -bin/bacula stop 2>&1 >/dev/null -cd bin -./drop_bacula_tables >/dev/null 2>&1 -./make_bacula_tables >/dev/null 2>&1 -./grant_bacula_privileges 2>&1 >/dev/null -cd .. - +scripts/cleanup scripts/cleanup-tape scripts/copy-tape-confs echo "/lib" >${cwd}/tmp/file-list @@ -20,8 +14,8 @@ echo " " echo " === Starting lib-tape-root test ===" echo " " echo " " -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf < >${cwd}/tmp/bconcmds @output /dev/null messages @output ${cwd}/tmp/log1.out @@ -40,7 +34,10 @@ messages @output quit END_OF_DATA -bin/bacula stop 2>&1 >/dev/null + +run_bacula +stop_bacula + cd / ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original cd ${cwd}/tmp/bacula-restores diff --git a/regress/tests/restore-by-file-tape b/regress/tests/restore-by-file-tape index fefc274ac8..060a43e73a 100755 --- a/regress/tests/restore-by-file-tape +++ b/regress/tests/restore-by-file-tape @@ -93,7 +93,7 @@ stop_bacula check_two_logs scripts/check_for_zombie_jobs storage=DDS-4 -bin/bacula stop 2>&1 >/dev/null +stop_bacula for i in `cat ${cwd}/tmp/restore2-list`; do diff $i ${cwd}/tmp/bacula-restores$i if [ $? != 0 ] ; then diff --git a/regress/tests/two-volume-changer b/regress/tests/two-volume-changer index e3d8ea66b8..8f3b5f8ebd 100755 --- a/regress/tests/two-volume-changer +++ b/regress/tests/two-volume-changer @@ -54,7 +54,7 @@ run_bacula check_for_zombie_jobs storage=DDS-4 stop_bacula -bin/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} unload $SLOT2 ${TAPE_DRIVE} 0 +$scripts/${AUTOCHANGER_SCRIPT} ${AUTOCHANGER} unload $SLOT2 ${TAPE_DRIVE} 0 cat <tmp/bconcmds @$out /dev/null diff --git a/regress/tests/usr-tape-root b/regress/tests/usr-tape-root index dbc0ed9daf..8d551aca66 100755 --- a/regress/tests/usr-tape-root +++ b/regress/tests/usr-tape-root @@ -15,8 +15,7 @@ echo " === Starting usr-tape-root test ===" echo " " echo " " -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf < ${cwd}/tmp/bconcmds @output /dev/null messages @output tmp/log1.out @@ -35,7 +34,8 @@ messages @output quit END_OF_DATA -bin/bacula stop 2>&1 >/dev/null +run_bacula +stop_bacula cd / ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original cd ${cwd}/tmp/bacula-restores diff --git a/regress/tests/vtape-test-changer b/regress/tests/vtape-test-changer index b4795ef3e7..c2811a2067 100755 --- a/regress/tests/vtape-test-changer +++ b/regress/tests/vtape-test-changer @@ -30,7 +30,7 @@ start_test when1=`perl -MPOSIX -e "print strftime('%F %T', localtime(time+30))"` when2=`perl -MPOSIX -e "print strftime('%F %T', localtime(time+45))"` -clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir.conf` +clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' $bin/bacula-dir.conf` # Catalog record for cleaning tape "CLN01" successfully created. # CLN01 | Cleaning