X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Ffour-jobs-tape;h=ff579c09a009a2616dda07176f422c52c1873ea6;hb=ec295417d8da11ae81fc3aec6f4ed22709695d01;hp=483af3d5bf140fe5cce89b988ac5fae9e1a395e6;hpb=dd6ee08b6617c96b862224a1a221f61f9f27f269;p=bacula%2Fbacula diff --git a/regress/tests/four-jobs-tape b/regress/tests/four-jobs-tape index 483af3d5bf..ff579c09a0 100755 --- a/regress/tests/four-jobs-tape +++ b/regress/tests/four-jobs-tape @@ -4,32 +4,40 @@ # then backup four times, each with incremental then finally restore. # It should require at least 4 different bsrs. # -cwd=`pwd` +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 at `date +%R:%S` ===" -echo " === Starting four-jobs-tape at `date +%R:%S` ===" >>working/log -echo " " +change_jobname $JobName +start_test -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null -estimate job=NightlySave listing -estimate job=NightlySave listing -estimate job=NightlySave listing +cat <${cwd}/tmp/bconcmds +@$out /dev/null +estimate job=$JobName listing +estimate job=$JobName +estimate job=$JobName messages -@output tmp/log1.out +@$out ${cwd}/tmp/log1.out label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default -run job=NightlySave yes +run job=$JobName yes wait messages quit END_OF_DATA +if test "$debug" -eq 1 ; then + bin/bacula start + cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + bin/bacula start 2>&1 >/dev/null + cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 1 done" # make some files for the incremental to pick up @@ -39,15 +47,23 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a second job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <${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 +if test "$debug" -eq 1 ; then + bin/bacula start + cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + bin/bacula start 2>&1 >/dev/null + cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 2 done" touch ${cwd}/build/src/dird/*.c @@ -55,15 +71,23 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a third job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <${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 +if test "$debug" -eq 1 ; then + bin/bacula start + cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + bin/bacula start 2>&1 >/dev/null + cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 3 done" # make some files for the incremental to pick up @@ -71,29 +95,37 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a fourth job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <${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 +if test "$debug" -eq 1 ; then + bin/bacula start + cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf +else + bin/bacula start 2>&1 >/dev/null + cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null +fi + 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 <&1 >/dev/null -@output /dev/null +cat <${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 done yes wait -@output tmp/log2.out +@$out ${cwd}/tmp/log2.out @# @# now unmount the tape and start two restores @# at the same time @@ -109,23 +141,14 @@ 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