]> git.sur5r.net Git - bacula/bacula/commitdiff
fix bad script tests + add smtp_host + fix tape options
authorKern Sibbald <kern@sibbald.com>
Sun, 25 Sep 2005 18:47:10 +0000 (18:47 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 25 Sep 2005 18:47:10 +0000 (18:47 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2402 91ce42f0-d328-0410-95d8-f526ca767f89

regress/Makefile.in
regress/kern.conf
regress/prototype.conf
regress/scripts/bacula-dir-win32-tape.conf
regress/scripts/cleanup-2drive.in
regress/scripts/cleanup-2tape.in
regress/scripts/do_sed
regress/scripts/regress-config
regress/scripts/setup
regress/tests/differential-test
regress/tests/two-vol-test

index 6b23951e2f25c98f80f9566502d16afc6dd1788c..d5d82a5053da72a07be1541501dbf370ce5f8723 100644 (file)
@@ -32,11 +32,11 @@ bacula: all sed
        rm -rf tmp working
        mkdir tmp working
        echo "Doing: scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB} ${TCPWRAPPERS}"
-       scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB} ${TCPWRAPPERS}
+       scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB} ${TCPWRAPPERS} ${SMTP_HOST}
 
 sed:
-       echo "Doing: scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH} ${TAPE_DRIVE1}"
-       scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH} ${TAPE_DRIVE1}
+       echo "Doing: scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH} ${TAPE_DRIVE1} ${SMTP_HOST}"
+       scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH} ${TAPE_DRIVE1} ${SMTP_HOST}
 
 # Run all non-root userid tests
 test: 
index b87dd8e8b5b7f8fed9ce75b4cb222af80ffb8ffc..55d6030c5ca70ab753961cdc963f8618e9b25d1b 100644 (file)
@@ -1,8 +1,10 @@
 # Where to get the source to be tested
+# BACULA_SOURCE="${HOME}/bacula/branch-1.36.2"
 BACULA_SOURCE="${HOME}/bacula/k"
 
 # Where to send email   !!!!! Change me !!!!!!!
 EMAIL=kern@sibbald.com
+SMTP_HOST="localhost"
 
 # Full "default" path where to find sqlite (no quotes!)
 SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
@@ -10,12 +12,14 @@ SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
 TAPE_DRIVE="/dev/nst0"
 # if you don't have an autochanger set AUTOCHANGER to /dev/null
 AUTOCHANGER="/dev/sg0"
+# For two drive tests -- set to /dev/null if you do not have it 
+TAPE_DRIVE1="/dev/nst1"
 
 # This must be the path to the autochanger including its name
 AUTOCHANGER_PATH="/usr/sbin/mtx"
 
 # Set your database here
-WHICHDB="--with-sqlite=${SQLITE_DIR}"
+WHICHDB?="--with-sqlite=${SQLITE_DIR}"
 #WHICHDB="--with-mysql=${HOME}/mysql"
 
 # Set this to "--with-tcp-wrappers" or "--without-tcp-wrappers"
index 70d931f8ffaf6bc84fd7546248671946a350bf4b..28f5d3ee5eadeaf767c2907055685c47b9587bcd 100644 (file)
@@ -12,6 +12,7 @@ BACULA_SOURCE=
 # Where to send email messages
 #
 EMAIL=
+SMTP_HOST=localhost
 
 # Full "default" path where to find sqlite. 
 # This is only used if you do not specify a database override on the
@@ -43,4 +44,3 @@ WHICHDB?="--with-sqlite=${SQLITE_DIR}"
 
 # Set this to "--with-tcp-wrappers" or "--without-tcp-wrappers"
 TCPWRAPPERS="--with-tcp-wrappers"
-
index 7877b8da3fa7bb80adf5e39b65e7418a410440fe..b9d3cf2c81d69a04ea7b4d269a0b4c80a62fa57f 100644 (file)
@@ -127,7 +127,7 @@ Messages {
 # Message delivery for daemon messages (no job).
 Messages {
   Name = Daemon
-  mailcommand = "/home/kern/bacula/regress/bin/bsmtp -h @smtp_host@ -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
+  mailcommand = "/home/kern/bacula/regress/bin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
   mail = kern@sibbald.com = all, !skipped            
   console = all, !skipped, !saved
   append = "/home/kern/bacula/regress/working/log" = all, !skipped
index e0857f7995ec894279e13e48581809576b1cb1a7..b15c3a93f90e6e559b623fd0a1f1e65779ccc927 100755 (executable)
@@ -4,23 +4,23 @@
 #
 scripts/cleanup
 
-if ! test x@autochanger@ = x/dev/null; then
+if test ! x@autochanger@ = x/dev/null; then
    slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
    echo "Slot $slot in drive 1"
-   if ! test x$slot = x0 ; then
+   if test ! x$slot = x0 ; then
       echo "unload slot $slot in drive 1"
       bin/mtx-changer @autochanger@ unload $slot @tape_drive1@ 1
    fi
    slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
    echo "Slot $slot in drive 0"
-   if ! test x$slot = x0 ; then
+   if test ! x$slot = x0 ; then
       echo "unload slot $slot in drive 0"
       bin/mtx-changer @autochanger@ unload $slot @tape_drive@ 0
    fi
 
 
    slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive1@ 1`
-   if ! test x$slot = x2; then
+   if test ! x$slot = x2; then
       echo "load slot 2 in drive 1"
       bin/mtx-changer @autochanger@ load 2 @tape_drive1@ 1
    fi
@@ -32,7 +32,7 @@ if ! test x@autochanger@ = x/dev/null; then
 
    slot=`bin/mtx-changer @autochanger@ loaded 0 @tape_drive@ 0`
    echo "Slot $slot in drive 0"
-   if ! test x$slot = x1; then
+   if test ! x$slot = x1; then
       echo "load slot 1 in drive 0"
       bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0
    fi
index 91cbb932882ab1e9b00e29c8c1dba69e16f8bbb8..737fe884e200daa51568f6e1082dc80e21379254 100755 (executable)
@@ -4,9 +4,9 @@
 #
 scripts/cleanup
 
-if ! test x@autochanger@ = x/dev/null; then
+if test ! x@autochanger@ = x/dev/null; then
    drive=`bin/mtx-changer @autochanger@ loaded`
-   if ! test x$drive = x2; then
+   if test ! x$drive = x2; then
       bin/mtx-changer @autochanger@ unload 0 @tape_drive@ 0
       bin/mtx-changer @autochanger@ load 2 @tape_drive@ 0
    fi
@@ -18,9 +18,9 @@ fi
 #
 # If we have an autochanger always load tape in slot 1
 #
-if ! test x@autochanger@ = x/dev/null; then
+if test ! x@autochanger@ = x/dev/null; then
    drive=`bin/mtx-changer @autochanger@ loaded`
-   if ! test x$drive = x1; then
+   if test ! x$drive = x1; then
       bin/mtx-changer @autochanger@ unload 0 @tape_drive@ 0
       bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0
    fi
index c4effe98f98220d2d389d6dbeb50356066c07ada..2f5791cf81719dc28ffbd67f5149261c0f84bdd2 100755 (executable)
@@ -1,11 +1,12 @@
 #!/bin/sh
 #
-if test $# != 5 ; then
+if test $# != 6 ; then
    echo "First arg must be email name"
    echo "  and the second must be a tape drive"
    echo "  and the third must be a tape control name or /dev/null"
    echo "  and the fourth must be the full path to the mtx program"
    echo "  and the fifth must be tape drive 1 or /dev/null"
+   echo "  and the sixth must be the smtp or email host"
    exit 1
 fi
 out="/tmp/sed_tmp"
@@ -28,6 +29,7 @@ echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
 echo "s%@hostname@%${host}%g" >>${out}
 echo "s%@changer_path@%${4}%g" >>${out}
 echo "s%@tape_drive1@%${5}%g" >>${out}
+echo "s%@smtp_host@%${6}%g" >>${out}
 
 # process .in files with sed script
 sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
@@ -55,11 +57,11 @@ chmod 777 ${cwd}/bin/mtx-changer
 
 # get proper SD tape definitions
 touch ${cwd}/bin/tape_options
-if test x`uname` = xLinux ; then \
-   cp -f ${cwd}/scripts/linux_tape_options ${cwd}/bin/tape_options ; \
+if test x`uname` = xLinux ; then
+   cp -f ${cwd}/scripts/linux_tape_options ${cwd}/bin/tape_options
 fi
-if test x`uname` = xFreeBSD ; then \
-   cp -f ${cwd}/scripts/freebsd_tape_options ${cwd}/bin/tape_options ; \
+if test x`uname` = xFreeBSD ; then
+   cp -f ${cwd}/scripts/freebsd_tape_options ${cwd}/bin/tape_options
 fi
 
 rm -f ${out}
index 95c8883892eb6ebb3b8bdf5e728a056eba7c3383..2fa59ffbcd9cc7ee0fbf13b530724eff8a6ed62c 100755 (executable)
@@ -15,6 +15,7 @@ CFLAGS="-g -O2 -Wall" \
     --with-working-dir=$1/working \
     --with-dump-email=$2 \
     --with-job-email=$2 \
+    --with-smtp-host=$5 \
     $3 \
     --with-baseport=8101 \
     $4
index 1f8ba1b5d7a862a2a5f34fcae43ad3a2dbc60f91..66b3634aca69f8aff4fe042e56fc647f8eeb9c0d 100755 (executable)
@@ -3,7 +3,7 @@
 # Script to setup running Bacula regression tests
 #
 cwd=`pwd`
-if [ $# != 4 ] ; then
+if [ $# != 5 ] ; then
    echo "Incorrect number of arguments. Got $#. Need:"
    echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
    echo " "
@@ -22,7 +22,7 @@ cp scripts/regress-config build
 cd build
 rm -f Makefile config.cache
 # Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3 $4
+./regress-config ${cwd} $2 $3 $4 $5
 make
 make install
 cp src/tools/testls ../bin
index 916cec507ff5c16fa5c9cdad1555c263fb155edb..3182e98cb763629018e9eb51a9c5cace2d672323 100755 (executable)
@@ -31,8 +31,8 @@ cat <<END_OF_DATA >tmp/bconcmds
 @$out /dev/null
 messages
 @$out tmp/log1.out
-label storage=File volume=TestVolume001
 label storage=File volume=TestVolume002
+label storage=File volume=TestVolume001
 run job=CompressedTest yes
 wait
 messages
@@ -56,7 +56,7 @@ cat <<END_OF_DATA >tmp/bconcmds
 messages
 @$out tmp/log1.out
 @# Force differential on the second Volume
-update volume=TestVolume001 VolStatus=Used
+update volume=TestVolume002 VolStatus=Used
 run level=differential job=CompressedTest yes
 wait
 messages
index ddf093180396f3ffad9608044b5dc2e49b69abd2..876b8fa011aec0ce43fd1b056aea12bc2b1dfb23 100755 (executable)
@@ -3,6 +3,13 @@
 # Run a simple backup of the Bacula build directory but 
 #   split the archive into two volumes
 #
+debug=0
+if test "$debug" -eq 1 ; then
+  out="tee"
+else
+  out="output"
+fi
+
 cwd=`pwd`
 scripts/copy-test-confs
 scripts/cleanup
@@ -14,30 +21,36 @@ echo " === Starting two-vol-test at `date +%R:%S` ==="
 echo " === Starting two-vol-test at `date +%R:%S` ===" >working/log
 echo " "
 
-bin/bacula start 2>&1 >/dev/null
-# bin/bacula start
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-#bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
 messages
-@output tmp/log1.out
-label storage=File1 volume=TestVolume001
+@$out tmp/log1.out
 label storage=File1 volume=TestVolume002
-update Volume=TestVolume001 MaxVolBytes=3000000
+label storage=File1 volume=TestVolume001
+update Volume=TestVolume002 MaxVolBytes=3000000
 run job=NightlySave storage=File1 yes
 wait
 messages
 @# 
 @# now do a restore
 @#
-@output tmp/log2.out
+@$out tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores select all storage=File1 done
 yes
 wait
 messages
-@output
+@$out
 quit
 END_OF_DATA
+
+if test "$debug" -eq 1 ; then
+  bin/bacula start
+  cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
+else
+  bin/bacula start 2>&1 >/dev/null
+  cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
+fi
+
 scripts/check_for_zombie_jobs storage=File1
 bin/bacula stop 2>&1 >/dev/null
 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null