]> git.sur5r.net Git - bacula/bacula/commitdiff
Updates plus put debug output and debugger on environment variables
authorKern Sibbald <kern@sibbald.com>
Tue, 29 May 2007 18:18:15 +0000 (18:18 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 29 May 2007 18:18:15 +0000 (18:18 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4932 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tests
regress/scripts/functions
regress/tests/2drive-concurrent-test [new file with mode: 0755]
regress/tests/four-concurrent-jobs-test

index c7536612d83c7a59e48d4bf46e64adf4aea9b078..e574f715afcf7d2f8a4297dd4537c217dac69df6 100755 (executable)
@@ -56,6 +56,7 @@ nice tests/two-volume-test
 nice tests/incremental-2disk
 nice tests/2drive-incremental-2disk
 nice tests/scratch-pool-test
+nice tests/2drive-concurrent-test
 echo " "
 echo "Test results"
 cat test.out
index 7da6d3805812f0c25b3106b396813a8bc415dc76..f00029c7e31b74e9ea62bd31a0222fb37fa478c8 100644 (file)
@@ -23,6 +23,7 @@ set_debug()
 
 run_bacula()
 {
+   debug_wait
    if test "$debug" -eq 1 ; then
      bin/bacula start
      cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
@@ -142,6 +143,18 @@ copy_test_confs()
    scripts/cleanup
 }
 
+debug_wait()
+{
+  if test "x${REGRESS_WAIT}" = "x1"; then
+     echo "Start Bacula under debugger and enter anything when ready ..."
+     read a
+  fi
+}
 
 # Save current directory
 cwd=`pwd`
+if test "x${REGRESS_DEBUG}" = "x1"; then
+   set_debug 1
+else
+   set_debug 0
+fi
diff --git a/regress/tests/2drive-concurrent-test b/regress/tests/2drive-concurrent-test
new file mode 100755 (executable)
index 0000000..a24854d
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/sh
+#
+# Run four jobs at the same time, with two Volumes.
+#   Set max Vol bytes of first volume
+#   to less than total backup to force Bacula to use the second
+#   Volume.
+#
+TestName="2drive-concurrent-test"
+JobName=Four-concurrent-jobs
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-2disk-drive-confs
+scripts/prepare-two-disks
+echo "${cwd}/build" >/tmp/file-list
+
+change_jobname NightlySave $JobName
+start_test
+
+cat <<END_OF_DATA >tmp/bconcmds
+@output /dev/null
+messages
+@$out   tmp/log1.out
+label pool=Default storage=DDS-4 volume=TestVolume001 slot=1 drive=0
+label pool=Default storage=DDS-4 volume=TestVolume002 slot=2 drive=1
+update Volume=TestVolume001 MaxVolBytes=100000000
+@#50000000
+@#12
+setdebug level=001 Storage=DDS-4
+status storage=DDS-4
+llist volume=TestVolume001
+llist volume=TestVolume002
+run job=$JobName level=Full Storage=DDS-4
+yes
+reload
+llist volume=TestVolume001
+llist volume=TestVolume002
+run job=$JobName level=Full Storage=DDS-4
+yes
+reload
+llist volume=TestVolume001
+llist volume=TestVolume002
+run job=$JobName level=Full Storage=DDS-4
+yes
+reload
+llist volume=TestVolume001
+llist volume=TestVolume002
+status storage=DDS-4
+run job=$JobName level=Full Storage=DDS-4
+yes
+status storage=DDS-4
+reload
+reload
+reload
+reload
+@sleep 2
+status dir
+status storage=DDS-4
+llist volume=TestVolume001
+llist volume=TestVolume002
+reload
+@sleep 5
+messages
+reload
+reload
+wait
+status storage=DDS-4
+reload
+messages
+@# 
+@# now do a restore
+@#
+@$out   tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select storage=DDS-4
+unmark *
+mark *
+done
+yes
+wait
+reload
+reload
+messages
+@output
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test
index 05a04e435a2fc71b514c5af49dcb9786fe215e74..b55a441f26d305422293e23468704fa3cd02b868 100755 (executable)
@@ -8,7 +8,6 @@
 TestName="four-concurrent-jobs-test"
 JobName=Four-concurrent-jobs
 . scripts/functions
-set_debug 0
 
 scripts/cleanup
 scripts/copy-test-confs
@@ -29,27 +28,37 @@ update Volume=TestVolume001 MaxVolBytes=100000000
 @#50000000
 @#12
 setdebug level=001 Storage=File1
-list volumes
+status storage=File1
+llist volume=TestVolume001
+llist volume=TestVolume002
 run job=$JobName level=Full Storage=File1
 yes
 reload
-list volumes
+llist volume=TestVolume001
+llist volume=TestVolume002
 run job=$JobName level=Full Storage=File1
 yes
 reload
-list volumes
+llist volume=TestVolume001
+llist volume=TestVolume002
 run job=$JobName level=Full Storage=File1
 yes
 reload
-list volumes
+llist volume=TestVolume001
+llist volume=TestVolume002
+status storage=File1
 run job=$JobName level=Full Storage=File1
 yes
+status storage=File1
 reload
 reload
 reload
 reload
 @sleep 2
 status dir
+status storage=File1
+llist volume=TestVolume001
+llist volume=TestVolume002
 reload
 @sleep 5
 messages