X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Frelabel-tape;h=d929db335892e6a1380bd17eea643a482905d935;hb=5dd06f639b5e883410a3af50727706a3d16e4028;hp=6b3a5b6e13bdae05dcacadfbe753aa0ad15cac89;hpb=93d14d5c387b87e381eee5ea8f9272b7ca979f68;p=bacula%2Fbacula diff --git a/regress/tests/relabel-tape b/regress/tests/relabel-tape index 6b3a5b6e13..d929db3358 100755 --- a/regress/tests/relabel-tape +++ b/regress/tests/relabel-tape @@ -4,64 +4,70 @@ # then backup four times, each with incremental then finally restore. # It should require at least 4 different bsrs. # -cwd=`pwd` +TestName="relabel-1t1d-tape" +JobName=Relabeltape +. scripts/functions + +require_tape_drive -scripts/copy-tape-confs scripts/cleanup-tape -echo "${cwd}/build" >/tmp/file-list +scripts/copy-tape-confs -echo " " -echo " " -echo " === Starting relabel-tape at `date +%R:%S` ===" -echo " === Starting relabel-tape at `date +%R:%S` ===" >>working/log -echo " " +echo "${cwd}/build" >${cwd}/tmp/file-list -bin/bacula start 2>&1 >/dev/null -#bin/bacula start -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -#bin/bconsole -c bin/bconsole.conf <${cwd}/tmp/bconcmds @output /dev/null messages -@output tmp/log1.out -label storage=DDS-4 volume=TestVolume001 slot=0 -run job=NightlySave level=Full yes +@$out ${cwd}/tmp/log1.out +label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default +run job=$JobName level=Full yes wait messages -add +add pool=Default storage=DDS-4 0 TestVolume002 -0 -no +@# set status to append update volume=TestVolume001 1 -4 . -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 +relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0 pool=Default storage=DDS-4 list volumes +mount storage=DDS-4 messages wait +run job=$JobName level=Full yes +wait messages -@output +@$out quit END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=DDS-4 + + echo "Backup 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 @@ -77,26 +83,15 @@ yes mount storage=DDS-4 wait messages -@output +@$out quit END_OF_DATA -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 + +run_bconsole + +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +check_two_logs +check_restore_diff +end_test