From 0f21097b862fdfc56794f092686fe205908c1ee8 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 27 Sep 2006 14:55:51 +0000 Subject: [PATCH] Update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3510 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/all-non-root-tape-tests | 4 +- regress/scripts/functions | 9 +++ regress/scripts/win32-bacula-dir-tape.conf.in | 4 +- regress/scripts/win32-bacula-sd-tape.conf | 4 +- regress/tests/backup-bacula-tape | 1 + regress/tests/bscan-fast-tape | 73 +++++++++++++++++++ regress/tests/bscan-tape | 2 +- regress/tests/two-pool-test | 4 - regress/tests/two-volume-tape | 14 ++++ regress/tests/win32-to-linux-tape | 4 +- 10 files changed, 106 insertions(+), 13 deletions(-) create mode 100755 regress/tests/bscan-fast-tape diff --git a/regress/all-non-root-tape-tests b/regress/all-non-root-tape-tests index 79870318e2..1adf56d1e8 100755 --- a/regress/all-non-root-tape-tests +++ b/regress/all-non-root-tape-tests @@ -2,14 +2,13 @@ # # Run all tape tests # -. config.out +. ./config.out if test ! x$AUTOCHANGER = x/dev/null ; then mtx -f $AUTOCHANGER load 1 >/dev/null &2>/dev/null fi cp test.out test1.out tests/test0 tests/backup-bacula-tape -tests/bscan-tape tests/btape-fill-tape tests/fixed-block-size-tape tests/four-concurrent-jobs-tape @@ -21,6 +20,7 @@ tests/small-file-size-tape tests/truncate-bug-tape tests/two-pool-tape tests/2drive-incremental-2tape +#tests/bscan-tape echo " " echo " " echo "Test results" diff --git a/regress/scripts/functions b/regress/scripts/functions index d3f8f85456..ff4501d350 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -50,6 +50,15 @@ run_btape() fi } +run_bscan() +{ + if test "$debug" -eq 1 ; then + bin/bscan $* | tee tmp/log.out + else + bin/bscan $* 2>&1 >/dev/null + fi +} + stop_bacula() { diff --git a/regress/scripts/win32-bacula-dir-tape.conf.in b/regress/scripts/win32-bacula-dir-tape.conf.in index bc3162b0c8..692e8452fa 100644 --- a/regress/scripts/win32-bacula-dir-tape.conf.in +++ b/regress/scripts/win32-bacula-dir-tape.conf.in @@ -5,7 +5,7 @@ # file or directory names in the Include directive of the # FileSet resource. # -# For Bacula release 1.33 +# For Bacula release 1.39.23 # # You might also want to change the default email address # from root to your address. See the "mail" and "operator" @@ -13,7 +13,7 @@ # Director { # define myself - Name = rufus-dir + Name = localhost-dir DIRport = 8101 # where we listen for UA connections QueryFile = "@scriptdir@/query.sql" WorkingDirectory = "@working_dir@" diff --git a/regress/scripts/win32-bacula-sd-tape.conf b/regress/scripts/win32-bacula-sd-tape.conf index 8589d67629..638b402cd8 100644 --- a/regress/scripts/win32-bacula-sd-tape.conf +++ b/regress/scripts/win32-bacula-sd-tape.conf @@ -1,7 +1,7 @@ # # Default Bacula Storage Daemon Configuration file # -# For Bacula release 1.33 +# For Bacula release 1.39.23 # # You may need to change the name of your tape drive # on the "Archive Device" directive in the Device @@ -22,7 +22,7 @@ Storage { # definition of myself # List Directors who are permitted to contact Storage daemon # Director { - Name = rufus-dir + Name = localhost-dir Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" } diff --git a/regress/tests/backup-bacula-tape b/regress/tests/backup-bacula-tape index 1494bcac9c..21d521d563 100755 --- a/regress/tests/backup-bacula-tape +++ b/regress/tests/backup-bacula-tape @@ -25,6 +25,7 @@ cat <tmp/bconcmds @output /dev/null messages @$out 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 diff --git a/regress/tests/bscan-fast-tape b/regress/tests/bscan-fast-tape new file mode 100755 index 0000000000..c6d2679bb1 --- /dev/null +++ b/regress/tests/bscan-fast-tape @@ -0,0 +1,73 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory using the compressed option +# then backup four times, each with incremental then +# do a bscan and restore. +# It should require at least 4 different bsrs. +# +TestName="bscan-tape" +JobName=bscantape +. scripts/functions +set_debug 1 + +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 + +change_jobname NightlySave $JobName +start_test + +cat <tmp/bconcmds +@output /dev/null +messages +@$out tmp/log1.out +setdebug level=100 storage=DDS-4 +label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +# +# now drop and recreate the database +# +cd bin +./drop_bacula_tables >/dev/null 2>&1 +./make_bacula_tables >/dev/null 2>&1 +./grant_bacula_privileges 2>&1 >/dev/null +cd .. + +echo "volume=TestVolume001" >tmp/bscan.bsr +bin/bscan -d200 -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 + +cat <tmp/bconcmds +@$out /dev/null +messages +@$out tmp/log2.out +@# +@# now do a restore +@# +restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula +rm -f ${cwd}/build/src/lib/dummy + +check_two_logs +check_restore_diff +end_test diff --git a/regress/tests/bscan-tape b/regress/tests/bscan-tape index 7f7e708c1e..a678206394 100755 --- a/regress/tests/bscan-tape +++ b/regress/tests/bscan-tape @@ -8,7 +8,7 @@ TestName="bscan-tape" JobName=bscantape . scripts/functions -set_debug 0 +set_debug 1 copy_tape_confs diff --git a/regress/tests/two-pool-test b/regress/tests/two-pool-test index bec846f236..4cd29d8a34 100755 --- a/regress/tests/two-pool-test +++ b/regress/tests/two-pool-test @@ -15,10 +15,6 @@ JobName=Two-pool set_debug 0 . config.out -if test x${AUTOCHANGER} = x/dev/null ; then - echo "two-pool-test skipped. No autochanger." - exit -fi cwd=`pwd` scripts/cleanup scripts/copy-2disk-confs diff --git a/regress/tests/two-volume-tape b/regress/tests/two-volume-tape index 8d896e36df..b26e0a9d85 100755 --- a/regress/tests/two-volume-tape +++ b/regress/tests/two-volume-tape @@ -43,6 +43,20 @@ update Volume=TestVolume001 MaxVolBytes=3000000 pool=Default drive=0 run job=$JobName yes wait messages +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +mt -f ${TAPE_DRIVE} rewind +mtx -f ${AUTOCHANGER} unload +sleep 15 + +cat <tmp/bconcmds +@$out /dev/null +messages @# @# now do a restore @# diff --git a/regress/tests/win32-to-linux-tape b/regress/tests/win32-to-linux-tape index 66e4814e0a..780c7dfb8c 100755 --- a/regress/tests/win32-to-linux-tape +++ b/regress/tests/win32-to-linux-tape @@ -7,7 +7,7 @@ TestName="win32-to-linux-tape" JobName=AutoLabel . scripts/functions -set_debug 0 +set_debug 1 scripts/copy-win32-confs scripts/cleanup-tape @@ -33,7 +33,7 @@ messages @# now do a restore @# @$out tmp/log2.out -restore where=c:/tmp/bacula-restores client=Tibs select all storage=DDS-4 done +restore where=/tmp/bacula-restores client=Tibs select all storage=DDS-4 done yes wait messages -- 2.39.5