From ea796121ac0a2150ce8d44020d5b26054d89962a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 13 Oct 2006 09:10:01 +0000 Subject: [PATCH] Update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3552 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/scripts/prepare-two-tapes.in | 1 + regress/tests/2drive-incremental-2disk | 75 ++++++++++---------------- regress/tests/truncate-bug-tape | 3 +- regress/tests/two-pool-tape | 2 + 4 files changed, 32 insertions(+), 49 deletions(-) diff --git a/regress/scripts/prepare-two-tapes.in b/regress/scripts/prepare-two-tapes.in index f31c0abe55..8d47b7e8c0 100755 --- a/regress/scripts/prepare-two-tapes.in +++ b/regress/scripts/prepare-two-tapes.in @@ -2,6 +2,7 @@ # # Create two blank tapes # +# mt -f @tape_drive@ offline @changer_path@ -f @autochanger@ unload @changer_path@ -f @autochanger@ load 1 mt -f @tape_drive@ rewind diff --git a/regress/tests/2drive-incremental-2disk b/regress/tests/2drive-incremental-2disk index f3972b0adc..b5eed3ca44 100755 --- a/regress/tests/2drive-incremental-2disk +++ b/regress/tests/2drive-incremental-2disk @@ -6,22 +6,20 @@ # This script uses the virtual disk autochanger and two drives # . config.out -debug=0 -if test "$debug" -eq 1 ; then - out="tee" -else - out="output" -fi +TestName="2drive-incremental-2disk" +JobName="2drive2disk" +. scripts/functions +set_debug 1 + cwd=`pwd` -bin/bacula stop 2>&1 >/dev/null -cd bin -./drop_bacula_tables >/dev/null 2>&1 -./make_bacula_tables >/dev/null 2>&1 -./grant_bacula_privileges 2>&1 >/dev/null -cd .. +scripts/cleanup scripts/copy-2disk-drive-confs scripts/prepare-two-disks + +change_jobname localhost-fd $JobName +start_test + echo "${cwd}/tmp/build" >/tmp/file-list if test ! -d ${cwd}/tmp/build ; then mkdir ${cwd}/tmp/build @@ -40,12 +38,6 @@ cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1 # otherwise, it writes the two jobs to different drives sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf -echo " " -echo " " -echo " === Starting 2drive-incremental-2disk test ===" -echo " === Starting 2drive-incremental-2disk test ===" >>working/log -echo " " - # Write out bconsole commands cat <tmp/bconcmds @output /dev/null @@ -53,7 +45,8 @@ messages @$out tmp/log1.out label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1 -setdebug level=100 storage=DDS-4 +status storage=DDS-4 +@#setdebug level=120 storage=DDS-4 run job=NightlySave yes run job=NightlySave yes run job=NightlySave yes @@ -69,13 +62,7 @@ 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 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt @@ -86,7 +73,7 @@ messages @# Force Incremental on the second Volume update volume=TestVolume001 VolStatus=Used status storage=DDS-4 -@#setdebug level=400 storage=DDS-4 +@#setdebug level=120 storage=DDS-4 run level=Incremental job=NightlySave yes wait list volumes @@ -106,30 +93,22 @@ messages @$out 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 + +run_bconsole +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +check_two_logs +# The restore should read from TestVolume002, which was on drive 1 +grep tmp/log2.out TestVolume002 +if [ $? != 0 ] ; then + rstat=$? fi -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=$? # # Delete .c files because we will only restored the txt files # rm -f tmp/build/*.c -diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null -if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then - echo " " - echo " " - echo " !!!!! 2drive-incremental-2disk test Bacula source failed!!! !!!!! " - echo " !!!!! 2drive-incremental-2disk test failed!!! !!!!! " >>test.out - echo " " -else - echo " ===== 2drive-incremental-2disk test Bacula source OK ===== " - echo " ===== 2drive-incremental-2disk test OK ===== " >>test.out - scripts/cleanup -fi +check_restore_tmp_build_diff + +end_test diff --git a/regress/tests/truncate-bug-tape b/regress/tests/truncate-bug-tape index 635b4dfa52..2273044fe5 100755 --- a/regress/tests/truncate-bug-tape +++ b/regress/tests/truncate-bug-tape @@ -6,7 +6,7 @@ TestName="truncate-bug-tape" JobName=truncatebug . scripts/functions -set_debug 0 +set_debug 1 copy_tape_confs echo "${cwd}/build" >/tmp/file-list @@ -32,6 +32,7 @@ run level=Full job=$JobName yes run level=Full job=$JobName yes run level=Full job=$JobName yes run level=Full job=$JobName yes +@#setdebug level=100 storage=DDS-4 wait messages quit diff --git a/regress/tests/two-pool-tape b/regress/tests/two-pool-tape index e7976181e1..9da395ae69 100755 --- a/regress/tests/two-pool-tape +++ b/regress/tests/two-pool-tape @@ -20,7 +20,9 @@ fi scripts/cleanup scripts/copy-2tape-confs +echo "Prepare two tapes" scripts/prepare-two-tapes +echo "Done prepare two tapes" # Make a relatively large backup set 5 x source code directory echo "${cwd}/build" >/tmp/file-list -- 2.39.5