]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/restore-seek-tape
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / restore-seek-tape
index 7d5b17b0d2bd7e31dd09ed0ebf8a8deff10d6c77..48473233fe5c05143d1d34061259f6d07245fc7e 100755 (executable)
@@ -1,4 +1,9 @@
 #!/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 
 #   to a tape where the maximum tape file size is set to 1M
@@ -10,12 +15,14 @@ TestName="restore-seek-tape"
 JobName=restore-tape-seek
 . scripts/functions
 
+require_tape_drive
+
 scripts/copy-tape-confs
 scripts/cleanup-tape
 
 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
 rm -rf ${cwd}/tmp/build
-mkdir ${cwd}/tmp/build
+mkdir -p ${cwd}/tmp/build
 # Copy only the .c files (to be restored)
 #  set files to "*.c" for all c files
 files="ua_tree.c ua_update.c"
@@ -37,7 +44,7 @@ cd ${cwd}
 # Now arrange to backup *everything*
 #
 rm -rf  ${cwd}/tmp/build
-mkdir ${cwd}/tmp/build
+mkdir -p ${cwd}/tmp/build
 cp -fp ${cwd}/build/src/dird/* ${cwd}/tmp/build
 #
 # Enable MaximumFileSize to ensure lots of JobMedia records and thus
@@ -53,7 +60,7 @@ cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out /dev/null
 messages
 @$out ${cwd}/tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 pool=Default
+label storage=tape volume=TestVolume001 pool=Default
 run job=$JobName yes
 wait
 messages
@@ -62,29 +69,28 @@ messages
 @#
 @$out ${cwd}/tmp/log2.out
 setdebug level=30 fd
-setdebug level=10 storage=DDS-4
+setdebug level=10 storage=tape
 sql
 @# print the JobMedia records
 select * from JobMedia;
 
-restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores storage=DDS-4
+restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores storage=tape
 7
 <${cwd}/tmp/restore-list
 
 yes
 wait
 messages
-@$out
 quit
 END_OF_DATA
 
 run_bacula
-check_for_zombie_jobs storage=DDS-4
+check_for_zombie_jobs storage=tape
 stop_bacula
 
 # Now setup a control directory of only what we *should* restore
 rm -rf ${cwd}/tmp/build
-mkdir  ${cwd}/tmp/build
+mkdir -p  ${cwd}/tmp/build
 for i in ${files}; do
    cp -p ${cwd}/build/src/dird/${i} ${cwd}/tmp/build
 done