]> git.sur5r.net Git - bacula/bacula/commitdiff
Add debug option to more tests
authorKern Sibbald <kern@sibbald.com>
Sat, 13 Aug 2005 14:06:53 +0000 (14:06 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 13 Aug 2005 14:06:53 +0000 (14:06 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2310 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/bacula-dir-tape.conf.in
regress/scripts/bacula-dir-win32-tape.conf
regress/scripts/cleanup-2tape.in
regress/tests/backup-bacula-tape
regress/tests/backup-bacula-test
regress/tests/bscan-tape
regress/tests/bsr-opt-test
regress/tests/fixed-block-size-tape
regress/tests/four-concurrent-jobs-tape
regress/tests/four-jobs-tape

index c7fa058ae8d0dfa0a360566594de5bc617c92888..f1fc0443c684d0fc68ba4b628cfd3f5deb0a4798 100644 (file)
@@ -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
 }
-
index 84898c71900135d35a166d87becf132a38ff7ba3..a54de6b4b2157bf575fbc8942831f226ea0fef79 100644 (file)
@@ -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"
index 70e6b7b0f00602f069e2a508da5dc51977010e27..91cbb932882ab1e9b00e29c8c1dba69e16f8bbb8 100755 (executable)
@@ -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
 
index 67cf4cc233f7ad0c2ad25d93fdbfef828bfb1588..1c6f5826c9a2e62fc8f2c269f101952d4539504a 100755 (executable)
@@ -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
 
index ad279addc1aa5b80d809731db9e710880ad56ca5..3b33a17c5accb620175a8c96931d0a3e59c65e61 100755 (executable)
@@ -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  <<END_OF_DATA 2>&1 >/dev/null
-#bin/bconsole -c bin/bconsole.conf  <<END_OF_DATA
-@output /dev/null
+cat <<END_OF_DATA >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
index 07c4aea41946a76fc8b97e5d34bab6a6dc72d992..6fe38d0bb2726bac73e99fa40b7b92154026b388 100755 (executable)
@@ -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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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 <<END_OF_DATA 2>&1 >/dev/null 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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 <<END_OF_DATA 2>&1 >/dev/null 2>&1 >/dev/null
-@output /dev/null
+
+cat <<END_OF_DATA >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 <<END_OF_DATA 2>&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
index b0ffe8209ade246a7fdd715c083a04bb575518e4..785f46145f2e9815943b02df0f93bccee3409f87 100755 (executable)
@@ -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 <<END_OF_DATA 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@tee /dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
 messages
-@tee tmp/log1.out
+@output tmp/log1.out
 label storage=File1 volume=TestVolume001
 label storage=File1 volume=TestVolume002
 update Volume=TestVolume001 MaxVolBytes=3000000
@@ -32,7 +32,7 @@ messages
 @# 
 @# now do a restore
 @#
-@tee tmp/log2.out
+@output tmp/log2.out
 restore bootstrap=${cwd}/working/restore.bsr where=${cwd}/tmp/bacula-restores select storage=File1
 unmark *
 cd ${cwd}/build/src/cats
@@ -42,7 +42,7 @@ done
 yes
 wait
 messages
-@tee
+@output
 quit
 END_OF_DATA
 scripts/check_for_zombie_jobs storage=File1
index 91a2a583cf86374cf840550bf3a9e78d2efa359e..69982162c2edada318516142704eccd69bbe755a 100755 (executable)
@@ -4,6 +4,12 @@
 #   to a tape where we set the minimum and maximum block
 #   sizes.
 #
+debug=0
+if test "$debug" -eq 1 ; then
+  out="tee"
+else
+  out="output"
+fi
 cwd=`pwd`
 scripts/copy-tape-confs
 scripts/cleanup-tape
@@ -28,11 +34,10 @@ echo " === Starting Fixed Block Size test at `date +%R:%S` ==="
 echo " === Starting Fixed Block Size test at `date +%R:%S` ===" >>working/log
 echo " "
 
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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
index 91a3dc9ae560d7bc8a179cddcfd4c02cccf16501..9831c6686f3b5a499d14f063b04cb1a4c5ccd026 100755 (executable)
@@ -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 <<END_OF_DATA 2>&1 >/dev/null
-#bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
+cat <<END_OF_DATA >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
index 483af3d5bf140fe5cce89b988ac5fae9e1a395e6..92e2e957651609540debfdd23f22a6bac068379e 100755 (executable)
@@ -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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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 <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >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=$?