X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Frecycle-test;h=701a0083e78fd0f5b7fad47cba4d2c7ac07981e9;hb=70f4723a1094c8c55d7a501ff52c1ff51a3542bf;hp=445f8e011746165c66540eb51b29651be678b940;hpb=643ad1c5607e6030487c6d0f807535487074c1fe;p=bacula%2Fbacula diff --git a/regress/tests/recycle-test b/regress/tests/recycle-test index 445f8e0117..701a0083e7 100755 --- a/regress/tests/recycle-test +++ b/regress/tests/recycle-test @@ -5,61 +5,82 @@ # volumes to be recycled, and cycling through the volumes # twice. Tests maxvoljobs and volretention. # -cwd=`pwd` -scripts/copy-test-confs +# Note, this test is a bit tricky, in that if you get too +# much data in the regress/build directory, the test will +# fail because it will run out of enough volumes to backup +# all the data. +# +TestName="recycle-test" +JobName=Recycle +. scripts/functions + scripts/cleanup -echo "${cwd}/build" >/tmp/file-list +scripts/copy-test-confs +echo "${cwd}/build" >${cwd}/tmp/file-list -echo " " -echo " " -echo " === Starting recycle-test ===" -echo " === Starting recycle-test ===" >working/log -echo " " +change_jobname NightlySave $JobName +start_test -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds @output /dev/null messages +@$out ${cwd}/tmp/log1.out label storage=File1 volume=TestVolume001 label storage=File1 volume=TestVolume002 label storage=File1 volume=TestVolume003 +label storage=File1 volume=TestVolume004 +@# Note, this is going to fail if the pruning gets +@# to tight because the saved volume is too large. +@# In that case, either add another volume, or +@# increase the volume capacity a bit. update Volume=TestVolume001 volretention=10s -update Volume=TestVolume001 maxvoljobs=1 +update Volume=TestVolume001 maxvolbytes=200000000 update Volume=TestVolume002 volretention=10s -update Volume=TestVolume002 maxvoljobs=1 +update Volume=TestVolume002 maxvolbytes=200000000 update Volume=TestVolume003 volretention=10s -update Volume=TestVolume003 maxvoljobs=1 +update Volume=TestVolume003 maxvolbytes=200000000 +update Volume=TestVolume004 volretention=10s +update Volume=TestVolume004 maxvolbytes=200000000 list volumes -run job=NightlySave storage=File1 level=full yes +setdebug level=150 storage=File1 +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes wait messages list volumes -run job=NightlySave storage=File1 level=full yes +@sleep 11 +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes wait messages list volumes -run job=NightlySave storage=File1 level=full yes +@sleep 11 +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes wait messages list volumes -@sleep 10 -run job=NightlySave storage=File1 level=full yes +@sleep 11 +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes wait messages list volumes -run job=NightlySave storage=File1 level=full yes -wait -messages -@output tmp/log1.out -list volumes -run job=NightlySave storage=File1 level=full yes +@sleep 11 +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes +run job=$JobName storage=File1 level=full yes wait messages list volumes @# @# now do a restore @# -@output tmp/log2.out +@$out ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select storage=File1 unmark * mark * @@ -70,28 +91,11 @@ messages @output quit END_OF_DATA -scripts/check_for_zombie_jobs storage=File1 -bin/bacula stop 2>&1 >/dev/null -grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null -bstat=$? -grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null -rstat=$? -diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null -if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! recycle-test Bacula source failed!!! !!!!! " - echo " !!!!! recycle-test failed!!! !!!!! " >>test.out - if [ $bstat != 0 -o $rstat != 0 ] ; then - echo " !!!!! Bad Job termination status !!!!! " - echo " !!!!! Bad Job termination status !!!!! " >>test.out - else - echo " !!!!! Restored files differ !!!!! " - echo " !!!!! Restored files differ !!!!! " >>test.out - fi - echo " " -else - echo " ===== recycle-test Bacula source OK ===== " - echo " ===== recycle-test OK ===== " >>test.out - scripts/cleanup -fi + +run_bacula +check_for_zombie_jobs storage=File1 +stop_bacula + +check_two_logs +check_restore_diff +end_test