From: Kern Sibbald Date: Sat, 1 Jul 2006 14:25:24 +0000 (+0000) Subject: Fix tape tests X-Git-Tag: Release-2.0.0~793 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5702311f9367e6ff64468f953704ab502ed454d5;p=bacula%2Fbacula Fix tape tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3104 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/functions b/regress/scripts/functions index 21613ad5de..12d05f4ccc 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -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() diff --git a/regress/tests/four-jobs-test b/regress/tests/four-jobs-test index ca56c665ce..ee93048a8a 100755 --- a/regress/tests/four-jobs-test +++ b/regress/tests/four-jobs-test @@ -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 diff --git a/regress/tests/incremental-tape b/regress/tests/incremental-tape index 263d9da6fe..3b7264da77 100755 --- a/regress/tests/incremental-tape +++ b/regress/tests/incremental-tape @@ -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 <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 diff --git a/regress/tests/restore-by-file-tape b/regress/tests/restore-by-file-tape index 2813fe2367..98827959f5 100755 --- a/regress/tests/restore-by-file-tape +++ b/regress/tests/restore-by-file-tape @@ -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 <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 <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 diff --git a/regress/tests/restore2-by-file-test b/regress/tests/restore2-by-file-test index b374c4020d..77b4e375a5 100755 --- a/regress/tests/restore2-by-file-test +++ b/regress/tests/restore2-by-file-test @@ -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 diff --git a/regress/tests/small-file-size-tape b/regress/tests/small-file-size-tape index 7e93525197..9c68cad1eb 100755 --- a/regress/tests/small-file-size-tape +++ b/regress/tests/small-file-size-tape @@ -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 <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 diff --git a/regress/tests/truncate-bug-tape b/regress/tests/truncate-bug-tape index 82b1cf54a8..0160275ac3 100755 --- a/regress/tests/truncate-bug-tape +++ b/regress/tests/truncate-bug-tape @@ -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 <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 <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 <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 -