]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Tweak regress scripts to be able to test distro binaries
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 9 Dec 2008 13:21:40 +0000 (13:21 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 9 Dec 2008 13:21:40 +0000 (13:21 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8129 91ce42f0-d328-0410-95d8-f526ca767f89

23 files changed:
regress/scripts/check_for_zombie_jobs
regress/scripts/cleanup-2drive.in
regress/scripts/cleanup-tape.in
regress/scripts/functions
regress/scripts/prepare-two-tapes.in
regress/scripts/setup
regress/tests/accurate-test
regress/tests/bextract-test
regress/tests/bscan-fast-tape
regress/tests/bscan-tape
regress/tests/bscan-test
regress/tests/btape-fill-full-tape
regress/tests/bug-fatal-test
regress/tests/concurrent-jobs-test
regress/tests/disk-changer-test
regress/tests/errors-test
regress/tests/four-jobs-tape
regress/tests/incremental-2disk
regress/tests/lib-tape-root
regress/tests/restore-by-file-tape
regress/tests/two-volume-changer
regress/tests/usr-tape-root
regress/tests/vtape-test-changer

index b1f689ee202d98410659b1ef2c71cfd3c8552c40..62ba3bece655fcdd366d44f96508cda92df4860e 100755 (executable)
@@ -14,7 +14,7 @@ else
     client=${HOST}-fd
 fi
 
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+$bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
 @output tmp/dir.out
 status dir
 @output tmp/fd.out
index e6fa40e99716d1f0d8c00cca1ab8ed3f340076c8..a0fbd6b08e21ce15a39c7e46fe5417d93c965d7f 100755 (executable)
@@ -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
index 86c3a198de5480cd5976a878d6fbe3a10a0dc25b..e08b12a854b3be6a53d31ccf41c9c835a45f16b1 100755 (executable)
@@ -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
index ef0e72e3f8c109990b8eb54ca7969d0f3f388db8..940b3dd1e0e48839da4ca74477dd31933614e027 100644 (file)
@@ -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
 
index 1093895ab7e08ba5b77187f71de793765c160d64..5d06bdca463e8ec4827ed5f29cb202a6617127c9 100755 (executable)
@@ -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"
index 4a6e81b2c9c37b7677cd01d9074612d19e7696ad..cf0c2ddfb00bd300b2b7c8ff2212da2c1fddee2e 100755 (executable)
@@ -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}"
index aac9861af8f9b6737e3cb539ff30adf45000f666..4ae2b1e66c00454a57dd72e27dc388289c795612 100755 (executable)
@@ -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 <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out ${cwd}/tmp/log1.out
index 0446bf7a7f530f24dcb305f68d731b6d376dea6a..32dafd3b309b1d66cb8986833d003c79fa30646c 100755 (executable)
@@ -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
index a6ba184c53f3291ca7331b1fcf12a6a721b3ee07..60affd3f6641fd2853c3e5e5ad6b4cc97955deff 100755 (executable)
@@ -34,7 +34,7 @@ quit
 END_OF_DATA
 
 echo "Starting Bacula tape writing"
-#bin/btape -c bin/bacula-sd.conf /dev/nst0 <<END_OF_DATA
+#$bin/btape -c bin/bacula-sd.conf /dev/nst0 <<END_OF_DATA
 #rewind
 #label
 #Test001
@@ -66,7 +66,7 @@ echo "volume=TestVolume001" >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 <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null
index 3cbcb3736292a542b6d44214766b3deba69c5af5..8c98c1e3e7141bba516cb3f576a344309949c09c 100755 (executable)
@@ -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
index 92f8ec6229eeab6c350c88fa8f009f140c8615fb..20ac940a3eba22d353c93ce80f1e9b366fad5344 100755 (executable)
@@ -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 <<END_OF_DATA >tmp/bconcmds
index dc3fcec98cd5cbebe73bc8c9f1e231182e776c5f..6c34094ab8302f16deaca80adf17818f67e6dbb0 100755 (executable)
@@ -14,7 +14,7 @@ scripts/cleanup-tape
 change_jobname $JobName
 start_test
 
-bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA 2>&1 >${cwd}/tmp/log1.out
+$bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA >${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 " "
index 249858d6fb6133e66e4863835aee14a031886edc..06776578100938628c23e86b45f4f85ca1d68b6b 100755 (executable)
@@ -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
index 37c69bd80197b8d354b4a8480edf20ded473930b..8726113f27d5b869dc49af79054cc1f7a974be65 100755 (executable)
@@ -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
index c0c0eec8c7217cb2941fcaf4057a9f61a06f01a2..b497098e23bf9c515dd3d04ed48e7fb39206652c 100755 (executable)
@@ -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=$?"   
index 5bd40fcb4914c40947c1306367ad6e87650900c8..5a57c42350469daa97670d8ced79b7cb1cc2c6b7 100755 (executable)
@@ -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
 
index ff579c09a009a2616dda07176f422c52c1873ea6..e3505277da6ffcc3dae342cc3d765a1b9b35ca22 100755 (executable)
@@ -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"
index 1c1efb4c0005c7f9d9b9ede5f6af95243333d911..48b36ce7217ac2b147b82dea22683b09f81b5cea 100755 (executable)
@@ -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
 
index b02c15284f28f9b8cae67f5de13e7225299c3a34..9044d1c088c7968967fe6d4373d6941834c249bd 100755 (executable)
@@ -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 <<END_OF_DATA
+
+cat <<END_OF_DATA > >${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
index fefc274ac860a9a6e17a3ef44769e0e2652ae018..060a43e73aed41c3857efd94bd451e52cefc8d5c 100755 (executable)
@@ -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
index e3d8ea66b8e87a0fc5d16b043c4b6fde5771b6d3..8f3b5f8ebde20813944c69fc2bc4f19094f55cc5 100755 (executable)
@@ -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 <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null
index dbc0ed9daf9050f2e0b1ff3eba1881da48d4eb4e..8d551aca6630e3002829815b4e385399c7bec270 100755 (executable)
@@ -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 <<END_OF_DATA
+cat <<END_OF_DATA > ${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
index b4795ef3e75e0cf5c3b513767bf529ae33dcf156..c2811a20679c4aaff3bfa17beb76a0f7279ed8e0 100755 (executable)
@@ -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