X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fbackup-bacula-tape;h=2e0fb1cbc7772de4c0d692181432305cab656e6d;hb=7d893884848432f4da69cbafe2021176b2d2a275;hp=37c42382a508fc2422489faee915d67252af669b;hpb=777f25e25bc84ea6569a497894d2ba957acc7bcc;p=bacula%2Fbacula diff --git a/regress/tests/backup-bacula-tape b/regress/tests/backup-bacula-tape index 37c42382a5..2e0fb1cbc7 100755 --- a/regress/tests/backup-bacula-tape +++ b/regress/tests/backup-bacula-tape @@ -6,36 +6,33 @@ # We also use the purge and the relabel commands as # well as a pile of status storage commands. # -debug=0 -if test "$debug" -eq 1 ; then - out="tee" -else - out="output" -fi +TestName="backup-bacula-tape" +JobName=backuptape +. scripts/functions + +require_tape_drive -cwd=`pwd` scripts/copy-tape-confs scripts/cleanup-tape -echo "${cwd}/build" >/tmp/file-list +echo "${cwd}/build" >${cwd}/tmp/file-list + +change_jobname NightlySave $JobName +start_test -echo " " -echo " " -echo " === Starting Backup Bacula tape test at `date +%R:%S` ===" -echo " === Starting Backup Bacula tape test at `date +%R:%S` ===" >>working/log -echo " " # Write out bconsole commands -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @output /dev/null messages -@$out tmp/log1.out +@$out ${cwd}/tmp/log1.out +@#setdebug level=200 storage=DDS-4 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default purge volume=TestVolume001 relabel pool=Default storage=DDS-4 oldVolume=TestVolume001 volume=TestVolume002 slot=0 purge volume=TestVolume002 relabel pool=Default storage=DDS-4 oldVolume=TestVolume002 volume=TestVolume001 slot=0 -run job=NightlySave yes +run job=$JobName yes status storage=DDS-4 status storage=DDS-4 status storage=DDS-4 @@ -71,7 +68,7 @@ messages @# @# now do a restore @# -@$out tmp/log2.out +@$out ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done yes wait @@ -79,34 +76,29 @@ list volumes messages END_OF_DATA -if test "$debug" -eq 1 ; then - bin/bacula start - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - bin/bacula start 2>&1 >/dev/null - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula -bin/bacula stop 2>&1 >/dev/null # # Now do a second backup after making a few changes # touch ${cwd}/build/src/dird/*.c echo "test test" > ${cwd}/build/src/dird/xxx -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @$out /dev/null messages -@$out tmp/log1.out +@$out ${cwd}/tmp/log1.out list volumes -run job=NightlySave yes +run job=$JobName yes wait list volumes messages @# @# now do a second restore @# -@$out tmp/log2.out +@$out ${cwd}/tmp/log2.out list volumes restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done yes @@ -117,29 +109,10 @@ messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - bin/bacula start - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - bin/bacula start 2>&1 >/dev/null - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi -scripts/check_for_zombie_jobs storage=DDS-4 +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula -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 " !!!!! Backup Bacula tape test failed!!! !!!!! " - echo " !!!!! Backup Bacula tape test failed!!! !!!!! " >>test.out - echo " " -else - echo " ===== Backup Bacula tape test OK ===== " - echo " ===== Backup Bacula tape test OK ===== " >>test.out - scripts/cleanup -fi +check_two_logs +check_restore_diff +end_test