]> git.sur5r.net Git - bacula/bacula/commitdiff
Clean up scripts
authorKern Sibbald <kern@sibbald.com>
Mon, 5 May 2003 10:31:48 +0000 (10:31 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 5 May 2003 10:31:48 +0000 (10:31 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@492 91ce42f0-d328-0410-95d8-f526ca767f89

16 files changed:
regress/README
regress/all-root-tests [new file with mode: 0755]
regress/all-tests
regress/scripts/do_sed
regress/scripts/regress-config
regress/scripts/setup
regress/scripts/test-bacula-dir.conf.in
regress/tests/backup-bacula-test
regress/tests/compressed-test
regress/tests/dev-test-root
regress/tests/etc-test-root
regress/tests/lib-test-root
regress/tests/sparse-compressed-test
regress/tests/sparse-test
regress/tests/two-jobs-test
regress/tests/verify-vol-test

index e9ebb627dd7199c0547915eeb5f4ad5ffdc8fbd8..fb6547d1561cefcc67a5c44d392a242eada64cbd 100644 (file)
@@ -2,19 +2,32 @@
      Kern Sibbald
      April 2003
 
-This is Bacula's regression script directory.
+This is Bacula's regression script directory.  At this time
+(May 2003), it is still in development, so all the tests are
+not complete.
 
 To set it up, first edit Makefile and set BACULA-SOURCE to point
 to your source.
 
-Second, make sure that depkgs is in the parent directory of this
-directory (i.e. at the same level) and that it is pre-built.
+!!!!!!!!!! IMPORTANT !!!!!!!!
+Second, edit the EMAIL address in the Makefile to be your
+email address and not mine or I will get LOTS of unwanted
+email!
+
+Third, edit the DEPKGS path in the Makefile to point to the
+depkgs directory.
+
+Fourth, make sure that depkgs is pre-built if it isn't 
+already: (cd your-depkgs; make sqlite).
 
 Then do:
 
    make setup
 
-You run the above one time.
+You run the above one time.  This will copy the Bacula
+source, configure, build it, and configure all the scripts
+and conf files.  If you change your source, you will need
+to redo this command. 
 
 Then you can run any of the tests in the tests subdirectory.
 Each test whose name ends in -root requires you to be root for
@@ -32,6 +45,7 @@ compressed-test
 sparse-compressed-test
 two-jobs-test
 wierd-files-test
+verify-vol-test
 
 The tests expect you to execute them from the main regress 
 directory!               
@@ -40,14 +54,15 @@ You can run them individually as:
 
    tests/two-jobs-test
 
-or all tests:
+or all non-root tests (my normal testing under my account)
+
+  ./all-non-root-tests
+
+or all tests (I only run these before a production release):
 
    su
    ./all-tests
 
-or all non-root tests
-
-  ./all-non-root-tests
 
 after running the root tests, while still root, it is a good idea
 to do:
@@ -55,3 +70,4 @@ to do:
    make reset
 
 this cleans up any files that may be created with root permissions.
+
diff --git a/regress/all-root-tests b/regress/all-root-tests
new file mode 100755 (executable)
index 0000000..723289b
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# Run all root tests
+#
+tests/dev-test-root
+tests/etc-test-root
+tests/lib-test-root
+cat test.out
index d8b5d1a0532f5e7a63d17f49cc596898d9390fef..8ab0e6be9dd740c75ff991b013a7bc16d96d2145 100755 (executable)
@@ -2,14 +2,6 @@
 #
 # Run all tests
 #
-tests/test0
-tests/backup-bacula-test
-tests/sparse-test
-tests/compressed-test
-tests/sparse-compressed-test
-tests/wierd-files-test
-tests/two-jobs-test
-tests/dev-test-root
-tests/etc-test-root
-tests/lib-test-root
+./all-non-root-tests
+./all-root-tests
 cat test.out
index 61ea5fcb39baeed355e3d93ce57190bf8e1d7d93..d063b45624899aed831a5235419890dc4f8fe17b 100755 (executable)
@@ -7,6 +7,7 @@ echo "s%@scriptdir@%${cwd}/bin%g" >>${out}
 echo "s%@working_dir@%${cwd}/bin/working%g" >>${out}
 echo "s%@piddir@%${cwd}/bin/working%g" >>${out}
 echo "s%@subsysdir@%${cwd}/bin/working%g" >>${out}
+echo "s%@job_email@%${1}%g">>${out}
 
 # process .in files with sed script
 sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
index 2e9581831766173931ae3665f147bca1907cd245..1d4737c1fc92e32f5ccef611511e9ae91d8c8fce 100755 (executable)
@@ -10,10 +10,10 @@ CFLAGS="-g -O2 -Wall" \
     --with-pid-dir=$1/bin/working \
     --with-subsys-dir=$1/bin/working \
     --enable-smartalloc \
-    --with-sqlite=$1/../depkgs/sqlite \
+    --with-sqlite=$2 \
     --with-working-dir=$1/bin/working \
-    --with-dump-email=kern+ok@sibbald.com \
-    --with-job-email=kern+ok@sibbald.com \
+    --with-dump-email=$3 \
+    --with-job-email=$3 \
     --with-baseport=8101 
 
 exit 0
index 242291e8656a0a979dd2fb992cc0614be57cf9b8..48d71231d35c0e770068a6fbca8fd6236ff9926f 100755 (executable)
@@ -3,8 +3,9 @@
 # Script to setup running Bacula regression tests
 #
 cwd=`pwd`
-if [ $# != 1 ] ; then
-   echo "Arg 1 must be a Bacula release directory."
+if [ $# != 3 ] ; then
+   echo "Incorrect number of arguments. Need:"
+   echo "setup bacula-src depkgs email-address"
    echo " "
    exit 1
 fi
@@ -13,18 +14,21 @@ if [ ! -d $1 ] ; then
    echo " "
    exit 1
 fi
-if [ ! -d ../depkgs ] ; then
+if [ ! -d $2 ] ; then
    cd ..
    cwd=`pwd`
-   echo "The regression scripts require ${cwd}/depkgs but not found!" 
+   echo "The regression scripts require DEPKGS as arg 2 but not found!" 
    echo " "
    exit 1
 fi
 rm -rf build bin
+# Copy new source
 cp -rp $1 build
 cp scripts/regress-config build
 cd build
-./regress-config ${cwd}
+rm -f Makefile config.cache
+# Run Bacula configuration, make, install
+./regress-config ${cwd} $2 $3
 make
 make install
 cp src/tools/testls ../bin
@@ -34,10 +38,10 @@ bin/bacula stop
 bin/create_sqlite_database
 bin/drop_sqlite_tables
 bin/make_sqlite_tables
+# Start and stop Bacula to ensure conf files are OK
 bin/bacula start
 bin/bacula stop
 #
 # Save Bacula default conf files for later use
 #
 cp -f bin/*.conf scripts
-scripts/do_sed
index 3fee9d8476d1aa28686b02cfebdf99b6c24608a0..6dc0d244dc800c548d89a0217bd4d156002d24f3 100644 (file)
@@ -234,10 +234,10 @@ Catalog {
 #  and to the console
 Messages {
   Name = Standard
-  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
-  operatorcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
-  MailOnError = kern+ok@sibbald.com = all
-  operator = kern+ok@sibbald.com = mount
+  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
+  operatorcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
+  MailOnError = @job_email@ = all
+  operator = @job_email@ = mount
   console = all, !skipped
 #
 # WARNING! the following will create a file that you must cycle from
@@ -246,6 +246,19 @@ Messages {
 #
   append = "@working_dir@/log" = all, !skipped
 }
+
+Messages {
+  Name = NoEmail
+  mailcommand = "@sbindir@/smtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
+  console = all, !skipped
+#
+# WARNING! the following will create a file that you must cycle from
+#          time to time as it will grow indefinitely. However, it will
+#          also keep all your messages if the scroll off the console.
+#
+  append = "@working_dir@/log" = all, !skipped
+}
+
     
 # Default pool definition
 Pool {
index a1f650730593ad1843385a9994f0345c34a5fd24..a8039eebd0384b7110eb8cc023a623cae73103b6 100755 (executable)
@@ -51,5 +51,5 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== Backup Bacula Test OK ===== "
    echo "  ===== Backup Bacula Test OK ===== " >>test.out
+   rm -rf /tmp/bacula-restores /tmp/TestVolume001
 fi
-rm -rf /tmp/bacula-restores
index f41d915f664165fc40c6fe7745bf2da9e048f1e5..c7c4034935c354e9254cc03bead95a6e7d95dd5a 100755 (executable)
@@ -50,5 +50,5 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== compressed-test Bacula source OK ===== "
    echo "  ===== compressed-test OK ===== " >>test.out
+   rm -rf /tmp/bacula-restores /tmp/TestVolume001
 fi
-rm -rf /tmp/bacula-restores
index 99db4b6b4a7bda4674e01b9cb6060df1624f164b..23d3fddf8c9f773087ef82eeaa52e2e302e699bc 100755 (executable)
@@ -48,9 +48,9 @@ quit
 END_OF_DATA
 bin/bacula stop
 cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >/tmp/original
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
 cd /tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >/tmp/restored
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
 diff /tmp/original /tmp/restored
 if [ $? != 0 ] ; then
    echo " "
@@ -61,6 +61,6 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== dev test OK ===== "
    echo "  ===== dev test OK ===== " >>test.out
-   rm -rf /tmp/bacula-restores /tmp/original /tmp/restored
+   rm -rf /tmp/bacula-restores ${cwd}/tmp/original ${cwd}/tmp/restored
    rm -rf /tmp/file-list /tmp/job /tmp/TestVolume001
 fi
index b8ab1ac2ff84ca0e35f8e43c9dc2294395e4ca79..c7adb3b52acb4ae6dc48d65bc1ad9ebc51d04633 100755 (executable)
@@ -48,10 +48,10 @@ quit
 END_OF_DATA
 bin/bacula stop
 cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >/tmp/original
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/original
 cd /tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >/tmp/restored
-diff /tmp/original /tmp/restored
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/restored
+diff ${cwd}/tmp/original ${cwd}/tmp/restored
 if [ $? != 0 ] ; then
    echo " "
    echo " "
@@ -61,6 +61,6 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== Test4 /etc OK ===== "
    echo "  ===== Test4 OK ===== " >>test.out
-   rm -rf /tmp/bacula-restores /tmp/original /tmp/restored
+   rm -rf /tmp/bacula-restores ${cwd}/tmp/original ${cwd}/tmp/restored
    rm -rf /tmp/file-list /tmp/job /tmp/TestVolume001
 fi
index b069eace791febeafa7c7acf3aea2b9d78e939c0..c0d9b2b9941b808f2e22148bfeb9aa7a632d1610 100755 (executable)
@@ -48,10 +48,10 @@ quit
 END_OF_DATA
 bin/bacula stop
 cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >/tmp/original
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original
 cd /tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >/tmp/restored
-diff /tmp/original /tmp/restored
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/restored
+diff ${cwd}/tmp/original ${cwd}/tmp/restored
 if [ $? != 0 ] ; then
    echo " "
    echo " "
@@ -61,6 +61,6 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== Test5 /lib OK ===== "
    echo "  ===== Test5 OK ===== " >>test.out
-   rm -rf /tmp/bacula-restores /tmp/original /tmp/restored
+   rm -rf /tmp/bacula-restores ${cwd}/tmp/original ${cwd}/tmp/restored
    rm -rf /tmp/file-list /tmp/job /tmp/TestVolume001
 fi
index b0e6f89b6d1b4e1c2280b802be934ccfce503751..0ec78a487303d1e825dc78afb66305750b57d4b5 100755 (executable)
@@ -51,5 +51,5 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== sparse-compressed-test Bacula source OK ===== "
    echo "  ===== sparse-compressed-test OK ===== " >>test.out
+   rm -rf /tmp/bacula-restores /tmp/TestVolume001
 fi
-rm -rf /tmp/bacula-restores
index 443c4440f4eb653b3e768fff5753f6613b83e6c1..9d536dc2f74487460901f2feb0b7d127cf5b3d4f 100755 (executable)
@@ -50,5 +50,5 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== sparse-test Bacula source OK ===== "
    echo "  ===== sparse-test OK ===== " >>test.out
+   rm -rf /tmp/bacula-restores /tmp/TestVolume001
 fi
-rm -rf /tmp/bacula-restores
index df56983ba4ced99babb56c2898a6afcbee0badf1..374d988337065dcc89de79318d18363e9187026a 100755 (executable)
@@ -59,5 +59,5 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== two-jobs-test Bacula source OK ===== "
    echo "  ===== two-jobs-test OK ===== " >>test.out
+   rm -rf /tmp/bacula-restores /tmp/TestVolume001
 fi
-rm -rf /tmp/bacula-restores
index 036a669f38b82a7a25ab9001b7ee9bff18a858b8..5d39ab13e2e1c2477b160ebd3907fd3b4a4ee570 100755 (executable)
@@ -6,6 +6,7 @@
 cwd=`pwd`
 scripts/copy-test-confs
 rm -rf /tmp/TestVolume001 /tmp/bacula-restores
+rm -f tmp/original
 bin/bacula stop 2>&1 >/dev/null
 bin/drop_sqlite_tables
 bin/make_sqlite_tables
@@ -32,14 +33,14 @@ messages
 run job=VerifyVolume
 yes
 wait
-@tee /tmp/original
+@tee ${cwd}/tmp/original
 messages
 @output
 quit
 END_OF_DATA
 sleep 2
 bin/bacula stop
-grep "Termination: *Verify OK" /tmp/original 2>&1 >/dev/null
+grep "Termination: *Verify OK" ${cwd}/tmp/original 2>&1 >/dev/null
 if [ $? != 0 ] ; then
    echo " "
    echo " "
@@ -49,6 +50,6 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== Verify Volume Test OK ===== "
    echo "  ===== Verify Volume Test OK ===== " >>test.out
+   rm -rf /tmp/bacula-restores /tmp/TestVolume001
+   rm -f ${cwd}/tmp/original
 fi
-rm -rf /tmp/bacula-restores
-rm -f /tmp/original