]> git.sur5r.net Git - bacula/bacula/commitdiff
Update root tests
authorKern Sibbald <kern@sibbald.com>
Thu, 8 Jul 2004 12:29:20 +0000 (12:29 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 8 Jul 2004 12:29:20 +0000 (12:29 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1462 91ce42f0-d328-0410-95d8-f526ca767f89

regress/tests/dev-test-root
regress/tests/etc-test-root
regress/tests/lib-test-root
regress/tests/usr-tape-root

index abb7823068f499821e83d0b75336c8c60eacc91f..a03287550f5e7df7f04a90c54fff83d2996ea30a 100755 (executable)
@@ -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 <<END_OF_DATA
 @output /dev/null
 messages
 @output tmp/log1.out
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
+label storage=File volume=TestVolume001
+run job=NightlySave yes
 wait
 messages
 @# 
@@ -55,27 +52,34 @@ ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${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 <<END_OF_DATA
 s%.*dev$%dev%
 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ptmx%dev/ptmx%
 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ttyp1%dev/ttyp1%
 s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/null%dev/null%
 END_OF_DATA
-sed -f sed.scr original | sort >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
index 59ec79755f9b5e733f3681f48b88610a3b3d0dee..859745edf3b862ec0926667665fe04889234110e 100755 (executable)
@@ -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 <<END_OF_DATA
 @output /dev/null
@@ -65,8 +60,8 @@ diff tmp/original tmp/restored 2>&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 ===== "
index 10b67103780f90b5ea2fb50da67cb60980f66050..7efeb347795bfcb372e188d698c51c18856f301f 100755 (executable)
@@ -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 <<END_OF_DATA
 @output /dev/null
@@ -70,8 +66,8 @@ diff tmp/original tmp/restored 2>&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 ===== "
index b4662bcfa8ae7d7fd0d8cede88e15cf46e337120..0f5002d92836f1c40bf0f024e553913d0631e5f5 100755 (executable)
@@ -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 <<END_OF_DATA
 @output /dev/null
@@ -57,8 +52,8 @@ diff tmp/original tmp/restored 2>&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 ===== "