X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Ffour-jobs-tape;h=e3505277da6ffcc3dae342cc3d765a1b9b35ca22;hb=ccb41474b231924fa189d67b4aac90f5f2a2899d;hp=78ac24d78de274f724d8e143b016ee7b399ee0fb;hpb=8bd785611ef1f93557a1d3ffb2bd81275077f122;p=bacula%2Fbacula diff --git a/regress/tests/four-jobs-tape b/regress/tests/four-jobs-tape index 78ac24d78d..e3505277da 100755 --- a/regress/tests/four-jobs-tape +++ b/regress/tests/four-jobs-tape @@ -4,38 +4,34 @@ # then backup four times, each with incremental then finally restore. # It should require at least 4 different bsrs. # -cwd=`pwd` -bin/bacula stop 2>&1 >/dev/null -cd bin -./drop_bacula_tables >/dev/null 2>&1 -./make_bacula_tables >/dev/null 2>&1 -./grant_bacula_privileges 2>&1 >/dev/null -cd .. +TestName="four-jobs-tape" +JobName=fourjobstape +. scripts/functions + +require_tape_drive -scripts/copy-tape-confs scripts/cleanup-tape -echo "${cwd}/build" >/tmp/file-list +scripts/copy-tape-confs +echo "${cwd}/build" >${cwd}/tmp/file-list -echo " " -echo " " -echo " === Starting four-jobs-tape ===" -echo " === Starting four-jobs-tape ===" >>working/log -echo " " +change_jobname $JobName +start_test -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds +@$out /dev/null +estimate job=$JobName listing +estimate job=$JobName +estimate job=$JobName messages -@output tmp/log1.out -label storage=DDS-4 volume=TestVolume001 slot=0 -run job=NightlySave yes +@$out ${cwd}/tmp/log1.out +label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default +run job=$JobName yes wait messages quit END_OF_DATA +run_bacula + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 1 done" # make some files for the incremental to pick up @@ -45,15 +41,18 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a second job # -bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out -run job=NightlySave level=Incremental yes +@$out ${cwd}/tmp/log1.out +run job=$JobName level=Incremental yes wait messages quit END_OF_DATA + +run_bacula + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 2 done" touch ${cwd}/build/src/dird/*.c @@ -61,15 +60,18 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a third job # -bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out -run job=NightlySave level=Incremental yes +@$out ${cwd}/tmp/log1.out +run job=$JobName level=Incremental yes wait messages quit END_OF_DATA + +run_bacula + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 3 done" # make some files for the incremental to pick up @@ -77,53 +79,54 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a fourth job # -bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out -run job=NightlySave level=Incremental yes +@$out ${cwd}/tmp/log1.out +run job=$JobName level=Incremental yes wait messages quit END_OF_DATA +run_bacula + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 4 done" # # now do several restores to ensure we cleanup between jobs # -bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds +@$out /dev/null +restore where=${cwd}/tmp/bacula-restores select all done yes wait -restore where=${cwd}/tmp/bacula-restores select all +restore where=${cwd}/tmp/bacula-restores select all done yes wait -@output tmp/log2.out +@$out ${cwd}/tmp/log2.out +@# +@# now unmount the tape and start two restores +@# at the same time +@# +unmount storage=DDS-4 +restore where=${cwd}/tmp/bacula-restores select all done +yes restore where=${cwd}/tmp/bacula-restores select unmark * mark * done yes +mount storage=DDS-4 wait messages -@output +@$out 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 2>&1 >/dev/null -if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! four-jobs-tape Bacula source failed!!! !!!!! " - echo " !!!!! four-jobs-tape failed!!! !!!!! " >>test.out - echo " " -else - echo " ===== four-jobs-tape Bacula source OK ===== " - echo " ===== four-jobs-tape OK ===== " >>test.out - scripts/cleanup -fi + +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +check_two_logs +check_restore_diff +end_test