From d1d0f449330ee1cde911271b061ca6c7d2b507c4 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 8 Jul 2004 12:29:20 +0000 Subject: [PATCH] Update root tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1462 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/tests/dev-test-root | 44 ++++++++++++++++++++----------------- regress/tests/etc-test-root | 15 +++++-------- regress/tests/lib-test-root | 16 +++++--------- regress/tests/usr-tape-root | 13 ++++------- 4 files changed, 39 insertions(+), 49 deletions(-) diff --git a/regress/tests/dev-test-root b/regress/tests/dev-test-root index abb7823068..a03287550f 100755 --- a/regress/tests/dev-test-root +++ b/regress/tests/dev-test-root @@ -7,8 +7,8 @@ MUID=`/usr/bin/id -u` if [ $MUID != 0 ] ; then echo " " echo "You must be root to run this test." - echo " ===== dev test failed!!! ===== " - echo " ===== dev test failed!!! ===== " >>test.out + echo " ===== !!!! dev-test-root not run !!!! ===== " + echo " ===== !!!! dev-test-root not run !!!! ===== " >>test.out echo " " exit 1 fi @@ -16,26 +16,23 @@ cwd=`pwd` scripts/copy-test-confs scripts/cleanup echo "/dev" >/tmp/file-list -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 .. + +echo " " echo " " +echo " === Starting dev-test-root test ===" echo " " -echo " === Starting /dev save/restore test ===" +echo " === Note, this test can fail for trivial ===" +echo " === reasons on non-Linux systems. ===" echo " " echo " " + bin/bacula start 2>&1 >/dev/null bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/original cd ${cwd}/tmp/bacula-restores ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored cd ${cwd}/tmp +# +# Use sed to cut out parts that *always* change +# cat >sed.scr <original + +# strip file system change messages then sed and sort +grep -v "Skip: File system change prohibited." original >1 +sed -f sed.scr 1 | sort >original # -sed -f sed.scr restored | sort >restored +mv -f restored 1 +sed -f sed.scr 1 | sort >restored rm -f sed.scr # cd ${cwd} -diff tmp/original tmp/restored 2>&1 1>/dev/null 2>&1 1>/dev/null +diff tmp/original tmp/restored 2>&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " " - echo " ===== dev test failed!!! ===== " - echo " ===== dev test failed!!! ===== " >>test.out + echo " ===== !!!! dev-test-root failed !!!! ===== " + echo " ===== !!!! dev-test-root failed !!!! ===== " >>test.out echo " " else - echo " ===== dev test OK ===== " - echo " ===== dev test OK ===== " >>test.out + echo " ===== dev-test-root OK ===== " + echo " ===== dev-test-root OK ===== " >>test.out scripts/cleanup fi diff --git a/regress/tests/etc-test-root b/regress/tests/etc-test-root index 59ec79755f..859745edf3 100755 --- a/regress/tests/etc-test-root +++ b/regress/tests/etc-test-root @@ -7,8 +7,8 @@ MUID=`/usr/bin/id -u` if [ $MUID != 0 ] ; then echo " " echo "You must be root to run this test." - echo " ===== etc-test-root failed!!! ===== " - echo " ===== etc-test-root failed!!! ===== " >>test.out + echo " ===== !!!! etc-test-root not run !!!! ===== " + echo " ===== !!!! etc-test-root not run !!!! ===== " >>test.out echo " " exit 1 fi @@ -21,12 +21,7 @@ cwd=`pwd` scripts/copy-test-confs scripts/cleanup echo "/etc" >/tmp/file-list -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 .. + bin/bacula start 2>&1 >/dev/null bin/bconsole -c bin/bconsole.conf <&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " " - echo " ===== etc-test-root failed!!! ===== " - echo " ===== etc-test-root failed!!! ===== " >>test.out + echo " ===== !!!! etc-test-root failed !!!! ===== " + echo " ===== !!!! etc-test-root failed !!!! ===== " >>test.out echo " " else echo " ===== etc-test-root OK ===== " diff --git a/regress/tests/lib-test-root b/regress/tests/lib-test-root index 10b6710378..7efeb34779 100755 --- a/regress/tests/lib-test-root +++ b/regress/tests/lib-test-root @@ -7,8 +7,8 @@ MUID=`/usr/bin/id -u` if [ $MUID != 0 ] ; then echo " " echo "You must be root to run this test." - echo " ===== lib-test-root failed!!! ===== " - echo " ===== lib-test-root failed!!! ===== " >>test.out + echo " ===== !!!! lib-test-root not run !!!! ===== " + echo " ===== !!!! lib-test-root not run !!!! ===== " >>test.out echo " " exit 1 fi @@ -16,17 +16,13 @@ cwd=`pwd` scripts/copy-test-confs scripts/cleanup echo "/lib" >/tmp/file-list -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 .. + echo " " echo " " echo " === Starting /lib save/restore test ===" echo " " echo " " + bin/bacula start 2>&1 >/dev/null bin/bconsole -c bin/bconsole.conf <&1 1>/dev/nul if [ $? != 0 ] ; then echo " " echo " " - echo " ===== lib-test-root failed!!! ===== " - echo " ===== lib-test-root failed!!! ===== " >>test.out + echo " ===== !!!! lib-test-root failed !!!! ===== " + echo " ===== !!!! lib-test-root failed !!!! ===== " >>test.out echo " " else echo " ===== lib-test-root OK ===== " diff --git a/regress/tests/usr-tape-root b/regress/tests/usr-tape-root index b4662bcfa8..0f5002d928 100755 --- a/regress/tests/usr-tape-root +++ b/regress/tests/usr-tape-root @@ -4,21 +4,16 @@ # then restore it. # cwd=`pwd` -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/copy-tape-confs scripts/cleanup-tape echo "/usr" >/tmp/file-list + echo " " echo " " echo " === Starting usr-tape-root test ===" echo " " echo " " + bin/bacula start 2>&1 >/dev/null bin/bconsole -c bin/bconsole.conf <&1 1>/dev/nul if [ $? != 0 ] ; then echo " " echo " " - echo " ===== usr-tape-root failed!!! ===== " - echo " ===== usr-tape-root failed!!! ===== " >>test.out + echo " ===== !!!! usr-tape-root failed !!!! ===== " + echo " ===== !!!! usr-tape-root failed !!!! ===== " >>test.out echo " " else echo " ===== usr-tape-root OK ===== " -- 2.39.5