X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Ftruncate-bug-tape;h=98c0b8387e77bd0fdc39649342c1eeacca1364aa;hb=3222975c6bc9cb425a40ecabd2a866a4028cb3f9;hp=7b7960446c0d0d4ffb44b9e373844ffa54a29d12;hpb=58bbaff3311b7c671c68e2a5cd74480dfe78c826;p=bacula%2Fbacula diff --git a/regress/tests/truncate-bug-tape b/regress/tests/truncate-bug-tape index 7b7960446c..98c0b8387e 100755 --- a/regress/tests/truncate-bug-tape +++ b/regress/tests/truncate-bug-tape @@ -2,47 +2,48 @@ # # Test for a tape truncation bug. # -cwd=`pwd` +TestName="truncate-bug-tape" +JobName=truncatebug +. scripts/functions -scripts/copy-tape-confs -scripts/cleanup-tape -echo "${cwd}/build" >/tmp/file-list +copy_tape_confs -echo " " -echo " " -echo " === Starting truncate-bug-tape test at `date +%R:%S` ===" -echo " === Starting truncate-bug-tape test at `date +%R:%S` ===" >>working/log -echo " " +echo "${cwd}/build" >${cwd}/tmp/file-list -#bin/bacula start 2>&1 >/dev/null -bin/bacula start -bin/bconsole -c bin/bconsole.conf <tmp/bconcmds +@output /dev/null messages -@tee tmp/log1.out -label storage=DDS-4 volume=TestVolume001 slot=0 +@$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 level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full job=NightlySave yes -run level=Full 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 +run level=Full job=$JobName yes +run level=Full job=$JobName yes +run level=Full job=$JobName yes +run level=Full job=$JobName yes +run level=Full job=$JobName yes +run level=Full job=$JobName yes +run level=Full job=$JobName yes +run level=Full job=$JobName yes +@#setdebug level=100 storage=DDS-4 wait messages quit END_OF_DATA + +run_bacula scripts/check_for_zombie_jobs storage=DDS-4 -bin/bconsole -c bin/bconsole.conf <tmp/bconcmds +@output /dev/null messages -@tee tmp/log1.out +@$out tmp/log2.out @# @# now do a restore @# @@ -57,32 +58,29 @@ done yes wait messages -@tee +@output quit END_OF_DATA + +run_bconsole scripts/check_for_zombie_jobs storage=DDS-4 -bin/bconsole -c bin/bconsole.conf <tmp/bconcmds +@output /dev/null messages -@tee tmp/log2.out -run level=Full job=NightlySave yes +@$out tmp/log3.out +run level=Full job=$JobName yes wait messages quit END_OF_DATA -bin/bacula stop 2>&1 >/dev/null -grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null -bstat=$? -grep "^ Termination: *Backup OK" tmp/log2.out 2>&1 >/dev/null -rstat=$? -if [ $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! truncate-bug-tape test Bacula source failed!!! !!!!! " - echo " !!!!! truncate-bug-tape test failed!!! !!!!! " >>test.out - echo " " -else - echo " ===== truncate-bug-tape test Bacula source OK ===== " - echo " ===== truncate-bug-tape test OK ===== " >>test.out - scripts/cleanup -fi + +run_bconsole +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +check_two_logs +grep "^ Termination: *Backup OK" tmp/log3.out 2>&1 >/dev/null +dstat=$? +end_test