]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/dev-test-root
ebl fix shell case..esac default condition
[bacula/bacula] / regress / tests / dev-test-root
index 26ae6fee840c3ad044f8b8c3b27c6f921efbc1e6..0d005e56b7f0a21d970504406586f00152e9288f 100755 (executable)
@@ -3,34 +3,22 @@
 # 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 "  ===== !!!! dev-test-root not run !!!! ===== "
-   echo "  ===== !!!! dev-test-root not run !!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
+
+TestName="dev-test-root"
+. scripts/functions
+
+require_root
+
 scripts/cleanup
 scripts/copy-test-confs
-echo "/dev" >/tmp/file-list
+echo "/dev" >${cwd}/tmp/file-list
 
-echo " "
-echo " "
-echo " ===     Starting dev-test-root test       ==="
-echo " "
-echo " ===  Note, this test can fail for trivial ==="
-echo " ===  reasons on non-Linux systems.        ==="
-echo " "
-echo " "
+start_test
 
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @output /dev/null
 messages
-@output tmp/log1.out
+@output ${cwd}/tmp/log1.out
 label storage=File volume=TestVolume001
 run job=NightlySave yes
 wait
@@ -38,7 +26,7 @@ messages
 @# 
 @# now do a restore
 @#
-@output tmp/log2.out
+@output ${cwd}/tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
@@ -46,7 +34,13 @@ 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 dev >${cwd}/tmp/original
 cd ${cwd}/tmp/bacula-restores
@@ -71,7 +65,7 @@ sed -f sed.scr 1 | sort >restored
 rm -f sed.scr
 #
 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 " "