]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/etc-test-root
Use getfattr and setfattr on Linux not attr as that is a XFS tool which works too...
[bacula/bacula] / regress / tests / etc-test-root
index 4237156f19e5dd053a8bb2353e0873b8750dfd9c..9ba0b1105ca9e4ff704ddbcdcb717b05fb0bb150 100755 (executable)
@@ -3,32 +3,19 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-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 " "
-   exit 1
-fi
-echo " "
-echo " "
-echo " === Starting /etc save/restore test ==="
-echo " "
-echo " "
-cwd=`pwd`
-scripts/copy-test-confs
+TestName="etc-test-root"
+. scripts/functions
+
 scripts/cleanup
-echo "/etc" >/tmp/file-list
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
+scripts/copy-test-confs
+echo "/etc" >${cwd}/tmp/file-list
+
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
 messages
-@output tmp/log1.out
+@$out ${cwd}/tmp/log1.out
 label storage=File
 TestVolume001
 run job=NightlySave
@@ -38,15 +25,23 @@ messages
 @# 
 @# now do a restore
 @#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select all
+@$out ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select    
+unmark *
+mark *
+done
 yes
 wait
 messages
-@output
 quit
 END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+# more cleanup needed below
+
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1       
 cd ${cwd}/tmp/bacula-restores
@@ -55,12 +50,12 @@ 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
+diff ${cwd}/tmp/original ${cwd}/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 ===== "