From: Kern Sibbald Date: Mon, 25 Jun 2007 07:19:22 +0000 (+0000) Subject: Apply fixes in bug #890 X-Git-Tag: Release-7.0.0~6084 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f2d751f02f74eda51a548adb208076d9684a7df2;p=bacula%2Fbacula Apply fixes in bug #890 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5079 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/functions b/regress/scripts/functions index cf35111670..19f955d533 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -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 diff --git a/regress/tests/dev-test-root b/regress/tests/dev-test-root index 26ae6fee84..66728d646b 100755 --- a/regress/tests/dev-test-root +++ b/regress/tests/dev-test-root @@ -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 <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 diff --git a/regress/tests/etc-test-root b/regress/tests/etc-test-root index e3a4495b88..2c5e24a1db 100755 --- a/regress/tests/etc-test-root +++ b/regress/tests/etc-test-root @@ -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 <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 diff --git a/regress/tests/lib-test-root b/regress/tests/lib-test-root index 8431672408..d50a5e067f 100755 --- a/regress/tests/lib-test-root +++ b/regress/tests/lib-test-root @@ -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 <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