]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/lib-test-root
Reorganize regex code
[bacula/bacula] / regress / tests / lib-test-root
index 4f41954a2963642b5000dc5ad1614480b6270aca..48067b2557f151b423d03d234ae4963145ef381f 100755 (executable)
@@ -3,31 +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 "  ===== !!!! lib-test-root not run !!!! ===== "
-   echo "  ===== !!!! lib-test-root not run !!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
+TestName="lib-test-root"
+. scripts/functions
+
+require_root
+
+
 scripts/cleanup
 scripts/copy-test-confs
-echo "/lib" >/tmp/file-list
+echo "/lib" >${cwd}/tmp/file-list
 
-echo " "
-echo " "
-echo " === Starting /lib save/restore test ==="
-echo " "
-echo " "
+start_test
 
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
+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
@@ -37,7 +28,7 @@ messages
 @# 
 @# now do a restore
 @#
-@output tmp/log2.out
+@$out ${cwd}/tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores select    
 unmark *
 mark *
@@ -45,10 +36,15 @@ 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 to be done below
+
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original
 cd ${cwd}/tmp/bacula-restores
@@ -62,7 +58,7 @@ sort <1 >restored
 rm -f 1
 #
 cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/nul
+diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 1>/dev/null
 if [ $? != 0 ] ; then
    echo " "
    echo " "