]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/lib-test-root
Before done change
[bacula/bacula] / regress / tests / lib-test-root
index c0d9b2b9941b808f2e22148bfeb9aa7a632d1610..10b67103780f90b5ea2fb50da67cb60980f66050 100755 (executable)
@@ -3,31 +3,36 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-echo " "
-echo " "
-echo " === /lib save/restore test ==="
-echo " "
-echo " "
-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 
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-bin/bacula start
-bin/console -c bin/console.conf <<END_OF_DATA
+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
 messages
-label
+@output tmp/log1.out
+label storage=File
 TestVolume001
 run job=NightlySave
 yes
@@ -36,31 +41,40 @@ 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
 quit
 END_OF_DATA
-bin/bacula stop
+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
+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
-   rm -rf /tmp/bacula-restores ${cwd}/tmp/original ${cwd}/tmp/restored
-   rm -rf /tmp/file-list /tmp/job /tmp/TestVolume001
+   echo "  ===== lib-test-root OK ===== "
+   echo "  ===== lib-test-root OK ===== " >>test.out
+   scripts/cleanup
 fi