]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/lib-tape-root
Fix regression minor scripting problems
[bacula/bacula] / regress / tests / lib-tape-root
index 8701602d4ea6e85556bc1914e0731fdaef8894b3..af06ec5a5bf2879b37ce126b763bf43ebf3ee555 100755 (executable)
@@ -1,45 +1,47 @@
 #!/bin/sh
+#
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+
 #
 # Run a simple backup of the /lib directory
 #   then restore it.
 #
 cwd=`pwd`
-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 ..
-
-scripts/copy-tape-confs
+. scripts/functions
+scripts/cleanup
 scripts/cleanup-tape
-echo "/lib" >/tmp/file-list
+scripts/copy-tape-confs
+echo "/lib" >${cwd}/tmp/file-list
 echo " "
 echo " "
 echo " === Starting lib-tape-root test ==="
 echo " "
 echo " "
-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
-label storage=DDS-4 Volume=TestVolume001 slot=0
+@$out ${cwd}/tmp/log1.out
+label storage=tape Volume=TestVolume001 slot=0
 run job=NightlySave yes
 wait
 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
+stop_bacula
+
 cd /
 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
 cd ${cwd}/tmp/bacula-restores
@@ -53,7 +55,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/nul
 if [ $? != 0 ] ; then
    echo " "
    echo " "