]> git.sur5r.net Git - bacula/bacula/commitdiff
Cleanup root tests
authorKern Sibbald <kern@sibbald.com>
Sat, 4 Oct 2003 14:58:58 +0000 (14:58 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 4 Oct 2003 14:58:58 +0000 (14:58 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@729 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-root-tests
regress/tests/dev-test-root
regress/tests/etc-test-root
regress/tests/lib-test-root

index 9eb8995c9ffdd4c859562a9cebd6cf88d5c1d062..ce7f7ae5332150ab599e9b3812877fe747a7c838 100755 (executable)
@@ -2,6 +2,7 @@
 #
 # Run all root tests
 #
+rm -f test.out
 tests/dev-test-root
 tests/etc-test-root
 tests/lib-test-root
index 8f21e22db52d60beb0659dc6d6d5f6d1c0c72d4f..194748ce18b04f22648b1f5861a402cb316a7e5b 100755 (executable)
@@ -3,13 +3,8 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-echo " "
-echo " "
-echo " === /dev save/restore test ==="
-echo " "
-echo " "
-UID=`/usr/bin/id -u`
-if [ $UID != 0 ] ; then
+MUID=`/usr/bin/id -u`
+if [ $MUID != 0 ] ; then
    echo " "
    echo "You must be root to run this test."
    echo "  ===== dev test failed!!! ===== "
@@ -19,15 +14,21 @@ if [ $UID != 0 ] ; then
 fi
 cwd=`pwd`
 scripts/copy-test-confs
+scripts/cleanup
 echo "/dev" >/tmp/file-list
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores
 bin/bacula stop 2>&1 >/dev/null
 bin/drop_sqlite_tables
 bin/make_sqlite_tables
+echo " "
+echo " "
+echo " === Starting /dev save/restore test ==="
+echo " "
+echo " "
 bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
 @output /dev/null
 messages
+@output tmp/log1.out
 label storage=File
 TestVolume001
 run job=NightlySave
@@ -37,11 +38,9 @@ messages
 @# 
 @# now do a restore
 @#
-restore
-5
-done
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores current all
 yes
-@sleep 1
 wait
 messages
 @output
@@ -50,9 +49,22 @@ END_OF_DATA
 bin/bacula stop 2>&1 >/dev/null
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
-cd /tmp/bacula-restores
+cd ${cwd}/tmp/bacula-restores
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
+cd ${cwd}/tmp
+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
+#
+sed -f sed.scr restored | sort >restored
+rm -f sed.scr
+#
+cd ${cwd}
+diff tmp/original tmp/restored 2>&1 1>/dev/null 2>&1 1>/dev/null
 if [ $? != 0 ] ; then
    echo " "
    echo " "
@@ -62,6 +74,5 @@ if [ $? != 0 ] ; then
 else
    echo "  ===== dev test OK ===== "
    echo "  ===== dev test OK ===== " >>test.out
-   cd ${cwd}
    scripts/cleanup
 fi
index 6459026b1224fa3372ef88b624a22e3174af28db..3181eba100ca12567670fc2c104e6736797a33e2 100755 (executable)
@@ -3,24 +3,24 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-echo " "
-echo " "
-echo " === /etc save/restore test ==="
-echo " "
-echo " "
-UID=`/usr/bin/id -u`
-if [ $UID != 0 ] ; then
+MUID=`/usr/bin/id -u`
+if [ $MUID != 0 ] ; then
    echo " "
    echo "You must be root to run this test."
-   echo "  ===== Test4 failed!!! ===== "
-   echo "  ===== Test4 failed!!! ===== " >>test.out
+   echo "  ===== etc-test-root failed!!! ===== "
+   echo "  ===== etc-test-root failed!!! ===== " >>test.out
    echo " "
    exit 1
 fi
+echo " "
+echo " "
+echo " === Starting /etc save/restore test ==="
+echo " "
+echo " "
 cwd=`pwd`
 scripts/copy-test-confs
+scripts/cleanup
 echo "/etc" >/tmp/file-list
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores
 bin/bacula stop 2>&1 >/dev/null
 bin/drop_sqlite_tables
 bin/make_sqlite_tables
@@ -28,6 +28,7 @@ bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
 @output /dev/null
 messages
+@output tmp/log1.out
 label storage=File
 TestVolume001
 run job=NightlySave
@@ -37,11 +38,9 @@ messages
 @# 
 @# now do a restore
 @#
-restore
-5
-done
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores current all
 yes
-@sleep 1
 wait
 messages
 @output
@@ -49,19 +48,22 @@ quit
 END_OF_DATA
 bin/bacula stop 2>&1 >/dev/null
 cd /
-${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 >${cwd}/tmp/restored
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1       
+cd ${cwd}/tmp/bacula-restores
+${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2
+sort <${cwd}/tmp/1 >${cwd}/tmp/original
+sort <${cwd}/tmp/2 >${cwd}/tmp/restored
+rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
+cd ${cwd}
+diff tmp/original tmp/restored 2>&1 1>/dev/null
 if [ $? != 0 ] ; then
    echo " "
    echo " "
-   echo "  ===== Test4 /etc failed!!! ===== "
-   echo "  ===== Test4 failed!!! ===== " >>test.out
+   echo "  ===== etc-test-root failed!!! ===== "
+   echo "  ===== etc-test-root failed!!! ===== " >>test.out
    echo " "
 else
-   echo "  ===== Test4 /etc OK ===== "
-   echo "  ===== Test4 OK ===== " >>test.out
-   cd ${cwd}
+   echo "  ===== etc-test-root OK ===== "
+   echo "  ===== etc-test-root OK ===== " >>test.out
    scripts/cleanup
 fi
index 60320fb39b6cb60c9bf36348f467ed67e8ce004b..b44dd3c67d779b18c21526a633229345c976e196 100755 (executable)
@@ -3,31 +3,32 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-echo " "
-echo " "
-echo " === /lib save/restore test ==="
-echo " "
-echo " "
-UID=`/usr/bin/id -u`
-if [ $UID != 0 ] ; then
+MUID=`/usr/bin/id -u`
+if [ $MUID != 0 ] ; then
    echo " "
    echo "You must be root to run this test."
-   echo "  ===== Test5 failed!!! ===== "
-   echo "  ===== Test5 failed!!! ===== " >>test.out
+   echo "  ===== lib-test-root failed!!! ===== "
+   echo "  ===== lib-test-root failed!!! ===== " >>test.out
    echo " "
    exit 1
 fi
 cwd=`pwd`
 scripts/copy-test-confs
+scripts/cleanup
 echo "/lib" >/tmp/file-list
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores
 bin/bacula stop 2>&1 >/dev/null
 bin/drop_sqlite_tables
 bin/make_sqlite_tables
+echo " "
+echo " "
+echo " === Starting /lib save/restore test ==="
+echo " "
+echo " "
 bin/bacula start 2>&1 >/dev/null
 bin/console -c bin/console.conf <<END_OF_DATA
 @output /dev/null
 messages
+@output tmp/log1.out
 label storage=File
 TestVolume001
 run job=NightlySave
@@ -37,11 +38,9 @@ messages
 @# 
 @# now do a restore
 @#
-restore
-5
-done
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores current all
 yes
-@sleep 1
 wait
 messages
 @output
@@ -50,18 +49,26 @@ END_OF_DATA
 bin/bacula stop 2>&1 >/dev/null
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original
-cd /tmp/bacula-restores
+cd ${cwd}/tmp/bacula-restores
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/restored
-diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
+cd ${cwd}/tmp
+sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
+sort <1 >original
+#
+sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
+sort <1 >restored
+rm -f 1
+#
+cd ${cwd}
+diff tmp/original tmp/restored 2>&1 1>/dev/nul
 if [ $? != 0 ] ; then
    echo " "
    echo " "
-   echo "  ===== Test5 /lib failed!!! ===== "
-   echo "  ===== Test5 failed!!! ===== " >>test.out
+   echo "  ===== lib-test-root failed!!! ===== "
+   echo "  ===== lib-test-root failed!!! ===== " >>test.out
    echo " "
 else
-   echo "  ===== Test5 /lib OK ===== "
-   echo "  ===== Test5 OK ===== " >>test.out
-   cd ${cwd}
+   echo "  ===== lib-test-root OK ===== "
+   echo "  ===== lib-test-root OK ===== " >>test.out
    scripts/cleanup
 fi