]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/dev-test-root
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / dev-test-root
index 26ae6fee840c3ad044f8b8c3b27c6f921efbc1e6..e5ad77e4bfd79114c0c2db110bb5613471fac090 100755 (executable)
@@ -1,36 +1,29 @@
 #!/bin/sh
+#
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+
 #
 # 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
-@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 volume=TestVolume001
 run job=NightlySave yes
 wait
@@ -38,15 +31,20 @@ messages
 @# 
 @# now do a restore
 @#
-@output tmp/log2.out
+@$out ${cwd}/tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores select all 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 dev >${cwd}/tmp/original
 cd ${cwd}/tmp/bacula-restores
@@ -71,7 +69,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 " "