X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=regress%2Ftests%2Fbscan-tape;h=56ef6e273b268af534fc4b645c4e7343fa94d70b;hb=891b48df6c5a15d1ee11f376c7b3113e81a60106;hp=5225103a89ad3ea51dbade59198d2422ba794779;hpb=0e5470001534d20ebe3b14e5717001c354f46f53;p=bacula%2Fbacula diff --git a/regress/tests/bscan-tape b/regress/tests/bscan-tape index 5225103a89..56ef6e273b 100755 --- a/regress/tests/bscan-tape +++ b/regress/tests/bscan-tape @@ -5,54 +5,43 @@ # do a bscan and restore. # It should require at least 4 different bsrs. # -debug=0 -if test "$debug" -eq 1 ; then - out="tee" -else - out="output" -fi - -cwd=`pwd` -scripts/copy-tape-confs -scripts/cleanup-tape +TestName="bscan-tape" +JobName=bscantape +. scripts/functions +set_debug 0 + +copy_tape_confs + echo "${cwd}/build" >/tmp/file-list cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf -echo " " -echo " " -echo " === Starting bscan-tape at `date +%R:%S` ===" -echo " === Starting bscan-tape at `date +%R:%S` ===" >>working/log -echo " " +change_jobname NightlySave $JobName +start_test cat <tmp/bconcmds @output /dev/null -estimate job=NightlySave listing -estimate job=NightlySave listing -estimate job=NightlySave listing +estimate job=$JobName listing +estimate job=$JobName listing +estimate job=$JobName listing messages @$out tmp/log1.out setdebug level=2 storage=DDS-4 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default -run job=NightlySave yes +run job=$JobName yes wait -run job=NightlySave level=Full yes +run job=$JobName level=Full yes wait -run job=NightlySave level=Full yes +run job=$JobName level=Full yes wait 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 + echo "Backup 1 done" # make some files for the incremental to pick up touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o @@ -65,20 +54,15 @@ cat <tmp/bconcmds @$out /dev/null messages @$out tmp/log1.out -run job=NightlySave level=Incremental yes +run job=$JobName level=Incremental yes wait 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 +run_bacula scripts/check_for_zombie_jobs storage=DDS-4 + echo "Backup 2 done" touch ${cwd}/build/src/dird/*.c touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o @@ -89,20 +73,15 @@ cat <tmp/bconcmds @$out /dev/null messages @$out tmp/log1.out -run job=NightlySave level=Incremental yes +run job=$JobName level=Incremental yes wait 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 +run_bacula scripts/check_for_zombie_jobs storage=DDS-4 + echo "Backup 3 done" # make some files for the incremental to pick up touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o @@ -110,25 +89,21 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a fourth job # - cat <tmp/bconcmds @$out /dev/null messages @$out tmp/log1.out -run job=NightlySave level=Incremental yes +run job=$JobName level=Incremental yes wait 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 + +run_bacula scripts/check_for_zombie_jobs storage=DDS-4 +stop_bacula + echo "Backup 4 done" # # now drop and recreate the database @@ -139,11 +114,10 @@ cd bin ./grant_bacula_privileges 2>&1 >/dev/null cd .. -bin/bacula stop 2>&1 >/dev/null echo "volume=TestVolume001" >tmp/bscan.bsr -bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null +bin/bscan -w working -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null + +cat <tmp/bconcmds @$out /dev/null messages @$out tmp/log2.out @@ -157,22 +131,12 @@ messages @$out quit END_OF_DATA -scripts/check_for_zombie_jobs storage=DDS-4 + +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula rm -f ${cwd}/build/src/lib/dummy -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 " !!!!! bscan-tape Bacula source failed!!! !!!!! " - echo " !!!!! bscan-tape failed!!! !!!!! " >>test.out - echo " " -else - echo " ===== bscan-tape Bacula source OK ===== " - echo " ===== bscan-tape OK ===== " >>test.out -# scripts/cleanup -fi + +check_two_logs +check_restore_diff +end_test