]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/etc-test-root
Final changes
[bacula/bacula] / regress / tests / etc-test-root
index e5770209a350c06148f3c518a9ef7d8ddadfa947..59ec79755f9b5e733f3681f48b88610a3b3d0dee 100755 (executable)
@@ -3,31 +3,35 @@
 # 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 -g`
-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
+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/console -c bin/console.conf <<END_OF_DATA
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
 @output /dev/null
 messages
+@output tmp/log1.out
 label storage=File
 TestVolume001
 run job=NightlySave
@@ -37,11 +41,12 @@ messages
 @# 
 @# now do a restore
 @#
-restore
-5
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select    
+unmark *
+mark *
 done
 yes
-@sleep 1
 wait
 messages
 @output
@@ -49,19 +54,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