X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Frelabel-tape;h=15b22c66a1ea69fb84dcfb7488df6908372e749b;hb=43170b6b4bc3f650fd69f40e234aee304226ef86;hp=b90c16e9e2616864c2a79b27baf91c6f002ef086;hpb=27fc1c02e1fffe4fc14dafd7254b2e294b4673bc;p=bacula%2Fbacula diff --git a/regress/tests/relabel-tape b/regress/tests/relabel-tape index b90c16e9e2..15b22c66a1 100755 --- a/regress/tests/relabel-tape +++ b/regress/tests/relabel-tape @@ -4,69 +4,59 @@ # then backup four times, each with incremental then finally restore. # It should require at least 4 different bsrs. # -debug=0 -if test "$debug" -eq 1 ; then - out="tee" -else - out="output" -fi +TestName="relabel-tape" +JobName=Relabeltape +. scripts/functions -cwd=`pwd` -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 relabel-tape at `date +%R:%S` ===" -echo " === Starting relabel-tape at `date +%R:%S` ===" >>working/log -echo " " +change_jobname $JobName +start_test -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @output /dev/null messages -@$out tmp/log1.out +@$out ${cwd}/tmp/log1.out label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default -run job=NightlySave level=Full yes +run job=$JobName level=Full yes wait messages -add pool=Default +add pool=Default storage=DDS-4 0 TestVolume002 @# set status to append update volume=TestVolume001 1 . -run job=NightlySave level=Full yes -@sleep 20 -unmount -unmount +run job=$JobName level=Full yes +wait +unmount storage=DDS-4 +unmount storage=DDS-4 +@#setdebug level=150 storage=DDS-4 purge volume=TestVolume001 -relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0 pool=Default +relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0 pool=Default storage=DDS-4 list volumes -mount +mount storage=DDS-4 messages wait -run job=NightlySave level=Full yes +run job=$JobName level=Full yes wait messages @$out 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 +run_bacula +check_for_zombie_jobs storage=DDS-4 + echo "Backup done" # # now do several restores to ensure we cleanup between jobs # -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @$out /dev/null restore where=${cwd}/tmp/bacula-restores select all done yes @@ -74,7 +64,7 @@ wait restore where=${cwd}/tmp/bacula-restores select all done yes wait -@$out tmp/log2.out +@$out ${cwd}/tmp/log2.out @# @# now unmount the tape and start two restores @# at the same time @@ -94,29 +84,11 @@ messages quit END_OF_DATA -if test "$debug" -eq 1 ; then - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf -else - cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null -fi +run_bconsole + +check_for_zombie_jobs storage=DDS-4 +stop_bacula -scripts/check_for_zombie_jobs storage=DDS-4 -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 -dstat=$? -if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! relabel-tape Bacula source failed!!! !!!!! " - echo " !!!!! relabel-tape failed!!! !!!!! " >>test.out - echo "diff=$dstat backup=$bstat restore=$rstat" - echo " " -else - echo " ===== relabel-tape Bacula source OK ===== " - echo " ===== relabel-tape OK ===== " >>test.out - scripts/cleanup -fi +check_two_logs +check_restore_diff +end_test