From: Kern Sibbald Date: Sat, 13 Aug 2005 14:06:53 +0000 (+0000) Subject: Add debug option to more tests X-Git-Tag: Release-1.38.0~194 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5809d50276243d9333a84e6fd9df58ba96b4a52c;p=bacula%2Fbacula Add debug option to more tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2310 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/bacula-dir-tape.conf.in b/regress/scripts/bacula-dir-tape.conf.in index c7fa058ae8..f1fc0443c6 100644 --- a/regress/scripts/bacula-dir-tape.conf.in +++ b/regress/scripts/bacula-dir-tape.conf.in @@ -94,7 +94,6 @@ Storage { Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon Device = DDS-4 # must be same as Device in Storage daemon Media Type = DDS-4 # must be same as MediaType in Storage daemon - AutoChanger = yes Maximum Concurrent Jobs = 4 } @@ -160,4 +159,3 @@ Pool { Volume Retention = 365d # one year Accept Any Volume = yes # write on any volume in the pool } - diff --git a/regress/scripts/bacula-dir-win32-tape.conf b/regress/scripts/bacula-dir-win32-tape.conf index 84898c7190..a54de6b4b2 100644 --- a/regress/scripts/bacula-dir-win32-tape.conf +++ b/regress/scripts/bacula-dir-win32-tape.conf @@ -13,7 +13,7 @@ # Director { # define myself - Name = roxie-dir + Name = rufus-dir DIRport = 8101 # where we listen for UA connections QueryFile = "/home/kern/bacula/regress/bin/query.sql" WorkingDirectory = "/home/kern/bacula/regress/working" diff --git a/regress/scripts/cleanup-2tape.in b/regress/scripts/cleanup-2tape.in index 70e6b7b0f0..91cbb93288 100755 --- a/regress/scripts/cleanup-2tape.in +++ b/regress/scripts/cleanup-2tape.in @@ -7,8 +7,8 @@ scripts/cleanup if ! test x@autochanger@ = x/dev/null; then drive=`bin/mtx-changer @autochanger@ loaded` if ! test x$drive = x2; then - bin/mtx-changer @autochanger@ unload - bin/mtx-changer @autochanger@ load 2 + bin/mtx-changer @autochanger@ unload 0 @tape_drive@ 0 + bin/mtx-changer @autochanger@ load 2 @tape_drive@ 0 fi mt -f @tape_drive@ rewind mt -f @tape_drive@ weof @@ -21,8 +21,8 @@ fi if ! test x@autochanger@ = x/dev/null; then drive=`bin/mtx-changer @autochanger@ loaded` if ! test x$drive = x1; then - bin/mtx-changer @autochanger@ unload - bin/mtx-changer @autochanger@ load 1 + bin/mtx-changer @autochanger@ unload 0 @tape_drive@ 0 + bin/mtx-changer @autochanger@ load 1 @tape_drive@ 0 fi fi diff --git a/regress/tests/backup-bacula-tape b/regress/tests/backup-bacula-tape index 67cf4cc233..1c6f5826c9 100755 --- a/regress/tests/backup-bacula-tape +++ b/regress/tests/backup-bacula-tape @@ -4,13 +4,14 @@ # to a tape then restore it, we do that twice to ensure that # we can correctly append to a tape. # -cwd=`pwd` debug=0 if test "$debug" -eq 1 ; then out="tee" else out="output" fi + +cwd=`pwd` scripts/copy-tape-confs scripts/cleanup-tape diff --git a/regress/tests/backup-bacula-test b/regress/tests/backup-bacula-test index ad279addc1..3b33a17c5a 100755 --- a/regress/tests/backup-bacula-test +++ b/regress/tests/backup-bacula-test @@ -3,6 +3,13 @@ # Run a simple backup of the Bacula build directory # then restore it. # +debug=0 +if test "$debug" -eq 1 ; then + out="tee" +else + out="output" +fi + cwd=`pwd` scripts/copy-confs scripts/cleanup @@ -13,13 +20,10 @@ echo " === Starting Backup Bacula Test at `date +%R:%S` ===" echo " === Starting Backup Bacula Test at `date +%R:%S` ===" >>working/log echo " " -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 <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out label volume=TestVolume001 run job=Client1 yes status storage=File @@ -45,14 +49,23 @@ messages @# @# now do a restore @# -@output tmp/log2.out +@$out tmp/log2.out restore where=${cwd}/tmp/bacula-restores select all done yes wait messages -@output +@$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 + scripts/check_for_zombie_jobs storage=File bin/bacula stop 2>&1 >/dev/null grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null diff --git a/regress/tests/bscan-tape b/regress/tests/bscan-tape index 07c4aea419..6fe38d0bb2 100755 --- a/regress/tests/bscan-tape +++ b/regress/tests/bscan-tape @@ -5,6 +5,13 @@ # 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 @@ -19,14 +26,13 @@ echo " === Starting bscan-tape at `date +%R:%S` ===" echo " === Starting bscan-tape at `date +%R:%S` ===" >>working/log echo " " -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null estimate job=NightlySave listing estimate job=NightlySave listing estimate job=NightlySave listing messages -@output tmp/log1.out +@$out tmp/log1.out setdebug level=2 storage=DDS-4 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default run job=NightlySave yes @@ -38,6 +44,14 @@ 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 echo "Backup 1 done" # make some files for the incremental to pick up @@ -47,15 +61,23 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a second job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out run job=NightlySave 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 + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 2 done" touch ${cwd}/build/src/dird/*.c @@ -63,15 +85,23 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a third job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null 2>&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out run job=NightlySave 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 + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 3 done" # make some files for the incremental to pick up @@ -80,15 +110,24 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a fourth job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null 2>&1 >/dev/null -@output /dev/null + +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out run job=NightlySave 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 + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 4 done" # @@ -105,9 +144,9 @@ 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 -@output /dev/null +@$out /dev/null messages -@output tmp/log2.out +@$out tmp/log2.out @# @# now do a restore @# @@ -115,7 +154,7 @@ restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done yes wait messages -@output +@$out quit END_OF_DATA scripts/check_for_zombie_jobs storage=DDS-4 diff --git a/regress/tests/bsr-opt-test b/regress/tests/bsr-opt-test index b0ffe8209a..785f46145f 100755 --- a/regress/tests/bsr-opt-test +++ b/regress/tests/bsr-opt-test @@ -18,11 +18,11 @@ echo " === Starting bsr-opt-test at `date +%R:%S` ===" >working/log echo " " bin/bacula start 2>&1 >/dev/null -#bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null +# bin/bconsole -c bin/bconsole.conf <>working/log echo " " -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default run job=NightlySave yes wait @@ -40,7 +45,7 @@ messages @# @# now do a restore @# -@output tmp/log2.out +@$out tmp/log2.out restore where=${cwd}/tmp/bacula-restores select storage=DDS-4 unmark * mark * @@ -48,9 +53,16 @@ done yes wait messages -@output +@$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 scripts/check_for_zombie_jobs storage=DDS-4 bin/bacula stop 2>&1 >/dev/null diff --git a/regress/tests/four-concurrent-jobs-tape b/regress/tests/four-concurrent-jobs-tape index 91a3dc9ae5..9831c6686f 100755 --- a/regress/tests/four-concurrent-jobs-tape +++ b/regress/tests/four-concurrent-jobs-tape @@ -2,6 +2,13 @@ # # Run two jobs at the same time # +debug=0 +if test "$debug" -eq 1 ; then + out="tee" +else + out="output" +fi + cwd=`pwd` scripts/copy-tape-confs scripts/cleanup-tape @@ -14,13 +21,10 @@ echo " === Starting four-concurrent-jobs-tape at `date +%R:%S` ===" echo " === Starting four-concurrent-jobs-tape at `date +%R:%S` ===" >>working/log echo " " -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 <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default run job=NightlySave level=Full Storage=DDS-4 yes run job=NightlySave level=Full Storage=DDS-4 yes @@ -35,7 +39,7 @@ messages @# @# now do a restore @# -@output tmp/log2.out +@$out tmp/log2.out restore where=${cwd}/tmp/bacula-restores select storage=DDS-4 unmark * mark * @@ -43,9 +47,17 @@ done yes wait messages -@output +@$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 + 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 diff --git a/regress/tests/four-jobs-tape b/regress/tests/four-jobs-tape index 483af3d5bf..92e2e95765 100755 --- a/regress/tests/four-jobs-tape +++ b/regress/tests/four-jobs-tape @@ -4,8 +4,13 @@ # 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 cwd=`pwd` - scripts/copy-tape-confs scripts/cleanup-tape echo "${cwd}/build" >/tmp/file-list @@ -16,20 +21,27 @@ echo " === Starting four-jobs-tape at `date +%R:%S` ===" echo " === Starting four-jobs-tape at `date +%R:%S` ===" >>working/log echo " " -bin/bacula start 2>&1 >/dev/null -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null estimate job=NightlySave listing estimate job=NightlySave listing estimate job=NightlySave listing messages -@output tmp/log1.out +@$out tmp/log1.out label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default run job=NightlySave 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 echo "Backup 1 done" # make some files for the incremental to pick up @@ -39,15 +51,23 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a second job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out run job=NightlySave 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 + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 2 done" touch ${cwd}/build/src/dird/*.c @@ -55,15 +75,23 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a third job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out run job=NightlySave 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 + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 3 done" # make some files for the incremental to pick up @@ -71,29 +99,37 @@ touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o # # run a fourth job # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <tmp/bconcmds +@$out /dev/null messages -@output tmp/log1.out +@$out tmp/log1.out run job=NightlySave 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 + scripts/check_for_zombie_jobs storage=DDS-4 echo "Backup 4 done" # # now do several restores to ensure we cleanup between jobs # -bin/bconsole -c bin/bconsole.conf <&1 >/dev/null -@output /dev/null +cat <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 tmp/log2.out @# @# now unmount the tape and start two restores @# at the same time @@ -109,9 +145,17 @@ yes mount storage=DDS-4 wait messages -@output +@$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 + bin/bacula stop 2>&1 >/dev/null grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null bstat=$?