]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/lib-test-root
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / lib-test-root
index 2b5aa8159654ed5bf30e69d3c99ab1e51c22d196..e05dc1f7ff7ecb88d955b299e8681a987652ce26 100755 (executable)
@@ -1,37 +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 "  ===== lib-test-root failed!!! ===== "
-   echo "  ===== lib-test-root failed!!! ===== " >>test.out
-   echo " "
-   exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
+TestName="lib-test-root"
+. scripts/functions
+
+require_root
+
+
 scripts/cleanup
-echo "/lib" >/tmp/file-list
-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
+scripts/copy-test-confs
+echo "/lib" >${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
@@ -41,15 +33,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 to be done below
+
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original
 cd ${cwd}/tmp/bacula-restores
@@ -63,12 +63,12 @@ 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 " "
-   echo "  ===== lib-test-root failed!!! ===== "
-   echo "  ===== lib-test-root failed!!! ===== " >>test.out
+   echo "  ===== !!!! lib-test-root failed !!!! ===== "
+   echo "  ===== !!!! lib-test-root failed !!!! ===== " >>test.out
    echo " "
 else
    echo "  ===== lib-test-root OK ===== "