]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix tape tests
authorKern Sibbald <kern@sibbald.com>
Sat, 1 Jul 2006 14:25:24 +0000 (14:25 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 1 Jul 2006 14:25:24 +0000 (14:25 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3104 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/functions
regress/tests/four-jobs-test
regress/tests/incremental-tape
regress/tests/restore-by-file-tape
regress/tests/restore2-by-file-test
regress/tests/small-file-size-tape
regress/tests/truncate-bug-tape

index 21613ad5de3f673b0805766c2f6f6164df37a988..12d05f4cccd944c69fab191e098173f993357f70 100644 (file)
@@ -74,7 +74,7 @@ change_jobname()
    mv bin/bacula-dir.conf bin/1
    echo "s%${oldname}%${newname}%g" >/tmp/1
    sed -f /tmp/1 bin/1 >bin/bacula-dir.conf
-   echo "Job ${oldname} changed to ${newname}"
+#  echo "Job ${oldname} changed to ${newname}"
 }
 
 check_two_logs()
index ca56c665ce052014ce270e3b5dac32c3ea785175..ee93048a8a5dbefbd98ec3ce1e9ebd5745e8445f 100755 (executable)
@@ -121,7 +121,7 @@ END_OF_DATA
 
 run_bconsole
 check_for_zombie_jobs storage=File
-bacula_stop
+stop_bacula
 
 check_two_logs
 check_restore_diff
index 263d9da6fe8a616a87237bcd957d4574f904cd0a..3b7264da77d382bed732f6b2dd2c01de35e06ff2 100755 (executable)
@@ -8,8 +8,8 @@ JobName=IncTape
 . scripts/functions
 set_debug 0
 
-scripts/copy-tape-confs
-scripts/cleanup-tape
+copy_tape_confs
+
 echo "${cwd}/tmp/build" >/tmp/file-list
 if test ! -d ${cwd}/tmp/build ; then
    mkdir ${cwd}/tmp/build
@@ -20,7 +20,7 @@ echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
 cd ${cwd}
 
-change_jobname $JobName
+change_jobname NightlySave $JobName
 start_test
 
 cat <<END_OF_DATA >tmp/bconcmds
@@ -34,7 +34,8 @@ messages
 quit
 END_OF_DATA
 
-scripts/check_for_zombie_jobs storage=DDS-4
+run_bacula
+check_for_zombie_jobs storage=DDS-4
 
 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
@@ -61,7 +62,7 @@ messages
 quit
 END_OF_DATA
 
-run_bacula
+run_bconsole
 check_for_zombie_jobs storage=DDS-4
 stop_bacula
 
index 2813fe2367c293d0896bb227779377f7b002a105..98827959f5e0f3084582616078498ef92f2b91ed 100755 (executable)
@@ -10,16 +10,15 @@ TestName="restore-by-file-tape"
 JobName=restorebyfile
 . scripts/functions
 set_debug 0
+copy_tape_confs
 
-scripts/copy-tape-confs
-scripts/cleanup-tape
 echo "${cwd}/build" >/tmp/file-list
 sed s%\^%${cwd}% ${cwd}/scripts/flist >${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
@@ -46,8 +45,6 @@ run_bacula
 check_for_zombie_jobs storage=DDS-4
 stop_bacula
 
-check_two_logs
-
 dstat=0
 #
 # We need to stop and start Bacula to
@@ -60,8 +57,6 @@ for i in `cat ${cwd}/tmp/restore2-list`; do
    fi
 done
 
-end_test
-
 cat <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
 messages
@@ -102,4 +97,5 @@ for i in `cat ${cwd}/tmp/restore2-list`; do
       dstat=1
    fi
 done
+
 end_test
index b374c4020d3fda9589646eb68dbe57a30834173a..77b4e375a57c78146e86cc33fa8d40bf33673644 100755 (executable)
@@ -7,10 +7,8 @@ TestName="restore2-by-file-test"
 JobName=restore2byfile
 . scripts/functions
 set_debug 0
+copy_test_confs
 
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
 echo "${cwd}/build" >/tmp/file-list
 sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
 
index 7e93525197620b8a96ec6177f3d36133a6fc8bc9..9c68cad1ebaee864221d63a7ee2157e403c687e4 100755 (executable)
@@ -8,20 +8,19 @@ JobName=smallfilesize
 . scripts/functions
 set_debug 0
 
-scripts/copy-tape-confs
-scripts/cleanup-tape
+copy_tape_confs
 
 echo "${cwd}/build" >/tmp/file-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
 messages
-@$out t tmp/log1.out
+@$out tmp/log1.out
 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
 setdebug level=2 storage=DDS-4
 run job=$JobName yes
index 82b1cf54a80a6431720150bbbd835194eba56277..0160275ac318cb99090553b1c40ca3ed4ebe803b 100755 (executable)
@@ -6,12 +6,11 @@ TestName="truncate-bug-tape"
 JobName=truncatebug
 . scripts/functions
 set_debug 0
+copy_tape_confs
 
-scripts/copy-tape-confs
-scripts/cleanup-tape
 echo "${cwd}/build" >/tmp/file-list
 
-change_jobname $JobName
+change_jobname NightlySave $JobName
 start_test
 
 cat <<END_OF_DATA >tmp/bconcmds
@@ -20,7 +19,7 @@ messages
 @$out   tmp/log1.out
 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
 @# do a bunch of saves so we have 12 files on the tape
-run job=NightlySave yes
+run job=$JobName yes
 run level=Full job=$JobName yes
 run level=Full job=$JobName yes
 run level=Full job=$JobName yes
@@ -43,7 +42,7 @@ scripts/check_for_zombie_jobs storage=DDS-4
 cat <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
 messages
-@$out tmp/log1.out
+@$out tmp/log2.out
 @# 
 @# now do a restore
 @#
@@ -65,23 +64,22 @@ END_OF_DATA
 run_bconsole
 scripts/check_for_zombie_jobs storage=DDS-4
 
+# Now write to tape one more time
 cat <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
 messages
-@$out tmp/log2.out
+@$out tmp/log3.out
 run level=Full job=$JobName yes
 wait
 messages
 quit
 END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
 
 run_bconsole
 check_for_zombie_jobs storage=DDS-4
 stop_bacula
 
 check_two_logs
-# no diff made
-dstat=0
+grep "^  Termination: *Backup OK" tmp/log3.out 2>&1 >/dev/null
+dstat=$?
 end_test
-