]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/restore-by-file-tape
regress: add function to create many dirs
[bacula/bacula] / regress / tests / restore-by-file-tape
index 2813fe2367c293d0896bb227779377f7b002a105..51a9b8f1caf92005165ba8bbfafd13a53174af7c 100755 (executable)
@@ -9,45 +9,44 @@
 TestName="restore-by-file-tape"
 JobName=restorebyfile
 . scripts/functions
-set_debug 0
+
+require_tape_drive
 
 scripts/copy-tape-confs
 scripts/cleanup-tape
-echo "${cwd}/build" >/tmp/file-list
-sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
+
+echo "${cwd}/build" >${cwd}/tmp/file-list
+sed s%\^%${cwd}% ${cwd}/scripts/flist | sort | uniq >${cwd}/tmp/restore2-list
 
 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
 sed "s%# Maximum File Size%  Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
 
-change_jobname $JobName
+change_jobname NightlySave $JobName
 start_test
 
-cat <<END_OF_DATA >tmp/bconcmds
-@output /dev/null
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
 messages
-@$out   tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
+@$out   ${cwd}/tmp/log1.out
+label storage=tape volume=TestVolume001 slot=0 pool=Default
 run job=$JobName level=Full yes
 wait
 messages
 @# 
 @# now do a restore
 @#
-@$out   tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores storage=DDS-4 file=<${cwd}/tmp/restore2-list
+@$out   ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores storage=tape file=<${cwd}/tmp/restore2-list
 yes
 wait
 messages
-@output
 quit
 END_OF_DATA
 
 run_bacula
-check_for_zombie_jobs storage=DDS-4
+check_for_zombie_jobs storage=tape
 stop_bacula
 
-check_two_logs
-
 dstat=0
 #
 # We need to stop and start Bacula to
@@ -60,19 +59,17 @@ for i in `cat ${cwd}/tmp/restore2-list`; do
    fi
 done
 
-end_test
-
-cat <<END_OF_DATA >tmp/bconcmds
-@output /dev/null
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
 messages
-@$out   tmp/log1.out
+@$out   ${cwd}/tmp/log1.out
 run job=$JobName  level=Full yes
 wait
 messages
 @#
 @# now do a restore
 @#
-@$out   tmp/log2.out
+@$out   ${cwd}/tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores
 7
 <${cwd}/tmp/restore2-list
@@ -80,7 +77,6 @@ restore where=${cwd}/tmp/bacula-restores
 yes
 wait
 messages
-@output
 quit
 END_OF_DATA
 
@@ -89,17 +85,18 @@ END_OF_DATA
 #  test appending to a previously written tape
 #
 run_bacula
-check_for_zombie_jobs storage=DDS-4
+check_for_zombie_jobs storage=tape
 stop_bacula
 
 check_two_logs
 
-scripts/check_for_zombie_jobs storage=DDS-4
-bin/bacula stop 2>&1 >/dev/null
+scripts/check_for_zombie_jobs storage=tape
+stop_bacula
 for i in `cat ${cwd}/tmp/restore2-list`; do
    diff $i ${cwd}/tmp/bacula-restores$i
    if [ $? != 0 ] ; then
       dstat=1
    fi
 done
+
 end_test