]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply fixes in bug #890
authorKern Sibbald <kern@sibbald.com>
Mon, 25 Jun 2007 07:19:22 +0000 (07:19 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 25 Jun 2007 07:19:22 +0000 (07:19 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5079 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/functions
regress/tests/dev-test-root
regress/tests/etc-test-root
regress/tests/lib-test-root

index cf3511167093b6c43ff52a84485707d5378e7c15..19f955d533a49725496ecf71de742118fa278bcd 100644 (file)
@@ -11,6 +11,19 @@ start_test()
    echo " "
 }
 
+require_root()
+{
+MUID=`/usr/bin/id | awk -F= '{print $2}' | awk -F\( '{print $1}'`
+if [ $MUID != 0 ] ; then
+   echo " "
+   echo "You must be root to run this test."
+   echo "  ===== !!!! $TestName not run at `date +%R:%S` ==="
+   echo "  ===== !!!! $TestName not run at `date +%R:%S` !!!! ===== " >>test.out
+   echo " "
+   exit 1
+fi
+
+
 set_debug()
 {
    debug=$1
index 26ae6fee840c3ad044f8b8c3b27c6f921efbc1e6..66728d646b30075fcf3b70dbbb0d76c67801617e 100755 (executable)
@@ -3,31 +3,19 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-MUID=`/usr/bin/id -u`
-if [ $MUID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== !!!! dev-test-root not run !!!! ===== "
-   echo "  ===== !!!! dev-test-root not run !!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
+
+TestName="dev-test-root"
+. scripts/functions
+
+require_root
+
 scripts/cleanup
 scripts/copy-test-confs
 echo "/dev" >/tmp/file-list
 
-echo " "
-echo " "
-echo " ===     Starting dev-test-root test       ==="
-echo " "
-echo " ===  Note, this test can fail for trivial ==="
-echo " ===  reasons on non-Linux systems.        ==="
-echo " "
-echo " "
+start_test
 
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+cat <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
 messages
 @output tmp/log1.out
@@ -46,7 +34,13 @@ messages
 @output
 quit
 END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
+
+run_bacula  
+check_for_zombie_jobs storage=File
+stop_bacula
+
+# More cleanup needed below
+
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
 cd ${cwd}/tmp/bacula-restores
index e3a4495b88cf033391ac2171d2127b4b4b86f80c..2c5e24a1db17336cc0e57fd2e4ba9c462222a21b 100755 (executable)
@@ -3,27 +3,16 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-MUID=`/usr/bin/id -u`
-if [ $MUID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== !!!! etc-test-root not run !!!! ===== "
-   echo "  ===== !!!! etc-test-root not run !!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-echo " "
-echo " "
-echo " === Starting /etc save/restore test ==="
-echo " "
-echo " "
-cwd=`pwd`
+TestName="etc-test-root"
+. scripts/functions
+
 scripts/cleanup
 scripts/copy-test-confs
 echo "/etc" >/tmp/file-list
 
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+start_test
+
+cat <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
 messages
 @output tmp/log1.out
@@ -47,7 +36,13 @@ messages
 @output
 quit
 END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+# more cleanup needed below
+
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1       
 cd ${cwd}/tmp/bacula-restores
index 8431672408a885dadce2aca36d41208e8481ba52..d50a5e067f14a017573fb2d5bd5e519636a75c6d 100755 (executable)
@@ -3,28 +3,19 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-MUID=`/usr/bin/id | awk -F= '{print $2}' | awk -F\( '{print $1}'`
-if [ $MUID != 0 ] ; then
-   echo " "
-   echo "You must be root to run this test."
-   echo "  ===== !!!! lib-test-root not run !!!! ===== "
-   echo "  ===== !!!! lib-test-root not run !!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
+TestName="lib-test-root"
+. scripts/functions
+
+require_root
+
+
 scripts/cleanup
 scripts/copy-test-confs
 echo "/lib" >/tmp/file-list
 
-echo " "
-echo " "
-echo " === Starting /lib save/restore test ==="
-echo " "
-echo " "
+start_test
 
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+cat <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
 messages
 @output tmp/log1.out
@@ -48,7 +39,13 @@ messages
 @output
 quit
 END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+# more cleanup to be done below
+
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original
 cd ${cwd}/tmp/bacula-restores