]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/truncate-bug-tape
Big backport from Enterprise
[bacula/bacula] / regress / tests / truncate-bug-tape
index 635b4dfa5284a5827f1ce173b336198c3fad5cd8..f144460610c009dc28f796b51f64dc8b660fb0a6 100755 (executable)
@@ -1,4 +1,9 @@
 #!/bin/sh
+#
+# Copyright (C) 2000-2015 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+
 #
 # Test for a tape truncation bug.
 #
@@ -6,20 +11,24 @@ TestName="truncate-bug-tape"
 JobName=truncatebug
 . scripts/functions
 
-set_debug 0
-copy_tape_confs
+require_tape_drive
+
+scripts/copy-tape-confs
+scripts/cleanup-tape
 
-echo "${cwd}/build" >/tmp/file-list
+echo "${cwd}/build" >${cwd}/tmp/file-list
 
 change_jobname NightlySave $JobName
 start_test
 
 cat <<END_OF_DATA >tmp/bconcmds
-@output /dev/null
+@$out /dev/null
 messages
 @$out   tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
+label storage=tape volume=TestVolume001 slot=0 pool=Default
 @# do a bunch of saves so we have 12 files on the tape
+@#setdebug level=100 dir
+setdebug level=50 storage=tape
 run job=$JobName yes
 run level=Full job=$JobName yes
 run level=Full job=$JobName yes
@@ -38,16 +47,16 @@ quit
 END_OF_DATA
 
 run_bacula
-scripts/check_for_zombie_jobs storage=DDS-4
+scripts/check_for_zombie_jobs storage=tape
 
 cat <<END_OF_DATA >tmp/bconcmds
-@output /dev/null
+@$out /dev/null
 messages
 @$out tmp/log2.out
 @# 
 @# now do a restore
 @#
-restore where=${cwd}/tmp/bacula-restores storage=DDS-4
+restore where=${cwd}/tmp/bacula-restores storage=tape
 3
 @# select JobId=4 (i.e. file five on the tape)
 4
@@ -58,16 +67,15 @@ done
 yes
 wait
 messages
-@output
 quit
 END_OF_DATA
 
 run_bconsole
-scripts/check_for_zombie_jobs storage=DDS-4
+scripts/check_for_zombie_jobs storage=tape
 
 # Now write to tape one more time
 cat <<END_OF_DATA >tmp/bconcmds
-@output /dev/null
+@$out /dev/null
 messages
 @$out tmp/log3.out
 run level=Full job=$JobName yes
@@ -77,7 +85,7 @@ quit
 END_OF_DATA
 
 run_bconsole
-check_for_zombie_jobs storage=DDS-4
+check_for_zombie_jobs storage=tape
 stop_bacula
 
 check_two_logs