X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Frecycle-test;h=467d959052a42eb4457c7e8c4823f5ff0066a30f;hb=7271a24188fe9a1cdc843844edaa42aeef6e6cc4;hp=239de70cc5faff867f43f3a330453b878cebfe77;hpb=26d6765c4e38f8bb003a783e1e737eac4d52028e;p=bacula%2Fbacula diff --git a/regress/tests/recycle-test b/regress/tests/recycle-test index 239de70cc5..467d959052 100755 --- a/regress/tests/recycle-test +++ b/regress/tests/recycle-test @@ -5,85 +5,96 @@ # 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 -bin/bacula stop 2>&1 >/dev/null -bin/drop_sqlite_tables -bin/make_sqlite_tables +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/console -c bin/console.conf <${cwd}/tmp/bconcmds +@$out /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 -restore where=${cwd}/tmp/bacula-restores current all +@$out ${cwd}/tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select storage=File1 +unmark * +mark * +done yes wait messages -@output 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: *Restore OK" tmp/log2.out 2>&1 >/dev/null -rstat=$? -diff -r build tmp/bacula-restores${cwd}/build -if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! recycle-test Bacula source failed!!! !!!!! " - echo " !!!!! recycle-test failed!!! !!!!! " >>test.out - 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