]> git.sur5r.net Git - bacula/bacula/commitdiff
Add new maxruntime test -- not yet working
authorKern Sibbald <kern@sibbald.com>
Mon, 13 Apr 2009 14:39:35 +0000 (14:39 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 13 Apr 2009 14:39:35 +0000 (14:39 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8725 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/bacula-dir.conf.maxruntime.in [new file with mode: 0644]
regress/scripts/do_sed
regress/tests/maxruntime-test [new file with mode: 0755]
regress/tests/maxtime-test
regress/tests/virtual-backup2-test

diff --git a/regress/scripts/bacula-dir.conf.maxruntime.in b/regress/scripts/bacula-dir.conf.maxruntime.in
new file mode 100644 (file)
index 0000000..a6afc96
--- /dev/null
@@ -0,0 +1,149 @@
+#
+# Default Bacula Director Configuration file
+#
+#  The only thing that MUST be changed is to add one or more
+#   file or directory names in the Include directive of the
+#   FileSet resource.
+#
+#  For Bacula release 1.39.27 (24 October 2006) -- debian testing/unstable
+#
+#  You might also want to change the default email address
+#   from root to your address.  See the "mail" and "operator"
+#   directives in the Messages resource.
+#
+
+Director {                            # define myself
+  Name = @hostname@-dir
+  DIRPort = @dirport@                # where we listen for UA connections
+  QueryFile = "@scriptdir@/query.sql"
+  WorkingDirectory = "@working_dir@"
+  PidDirectory = "@piddir@"
+  SubSysDirectory = "@subsysdir@"
+  Maximum Concurrent Jobs = 1
+  Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"         # Console password
+  Messages = Standard
+}
+
+JobDefs {
+  Name = "DefaultJob"
+  Type = Backup
+  Level = Incremental
+  Client = @hostname@-fd 
+  FileSet = FS_TESTJOB
+  Storage = File
+  Messages = Standard
+  Pool = Default
+  Priority = 10
+  Maximum Concurrent Jobs = 16
+}
+
+FileSet {
+ Name = FS_TESTJOB
+ Include {
+   File=<@tmpdir@/file-list
+ }
+}
+
+FileSet {
+ Name = FS_FIFO
+ Include {
+   Options {
+     read fifo = yes
+   }
+   # wait 60s per fifo
+   File=@tmpdir@/fifo
+   File=@tmpdir@/fifo2
+   File=@tmpdir@/fifo3
+ }
+}
+
+Job {
+  Name = "RUN_MAXWAITTIME"
+  JobDefs = DefaultJob
+  FileSet = FS_TESTJOB
+  MaxWaitTime = 2min
+}
+
+Job {
+  Name = "RUN_MAXSTARTDELAY"
+  JobDefs = DefaultJob
+  FileSet = FS_TESTJOB
+  MaxStartDelay = 30sec
+  Pool = PoolA
+  Runbeforejob = "/bin/echo NEVER start this"
+}
+
+Job {
+  Name = "RUN_MAXRUNTIME"
+  JobDefs = DefaultJob
+  FileSet = FS_FIFO
+  MaxRunTime = 1min
+  Max Start Delay = 4 hours
+  Maximum Concurrent Jobs = 10
+  Spool Data = no
+  Reschedule On Error = yes
+  Reschedule Interval = 30sec
+  Reschedule Times = 2
+  Max Full Interval = 28 days
+  Full Max Run Time = 1min
+  Cancel Queued Duplicates = no
+
+}
+
+# Client (File Services) to backup
+Client {
+  Name = @hostname@-fd
+  Address = @hostname@
+  FDPort = @fdport@
+  Catalog = MyCatalog
+  Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
+  File Retention = 30d                # 30 days
+  Job Retention = 180d                # six months
+  AutoPrune = yes                     # Prune expired Jobs/Files
+  Maximum Concurrent Jobs = 4
+}
+
+# Definiton of file storage device
+Storage {
+  Name = File
+  Address = @hostname@                # N.B. Use a fully qualified name here
+  SDPort = @sdport@
+  Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+  Device = FileStorage
+  Media Type = File
+  Maximum Concurrent Jobs = 4
+}
+
+# Generic catalog service
+Catalog {
+  Name = MyCatalog
+  @libdbi@
+  dbname = @db_name@; user = @db_user@; password = "@db_password@"
+}
+
+
+Messages {
+  Name = Standard
+  console = all, !skipped, !saved
+  catalog = all, !skipped
+}
+
+# Default pool definition
+Pool {
+  Name = Default
+  Pool Type = Backup
+  Recycle = yes                       # Bacula can automatically recycle Volumes
+  AutoPrune = yes                     # Prune expired volumes
+  Volume Retention = 365d             # one year
+  Maximum Volume Bytes = 1M
+}
+
+
+# Default pool definition
+Pool {
+  Name = PoolA
+  Pool Type = Backup
+  Recycle = yes                       # Bacula can automatically recycle Volumes
+  AutoPrune = yes                     # Prune expired volumes
+  Volume Retention = 365d             # one year
+}
index e986456e9e6efaac73f29de7dd89dd83f4df38a3..a5ac8be9b8933ed9afb74c3fb68016ed9fa22816 100755 (executable)
@@ -14,6 +14,7 @@ sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula
 sed -f ${out} ${cwd}/scripts/multi-client-bacula-dir.conf.in >${cwd}/scripts/multi-client-bacula-dir.conf
 sed -f ${out} ${cwd}/scripts/bacula-dir.conf.regexwhere.in >${cwd}/scripts/bacula-dir.conf.regexwhere
 sed -f ${out} ${cwd}/scripts/bacula-dir.conf.maxtime.in >${cwd}/scripts/bacula-dir.conf.maxtime
+sed -f ${out} ${cwd}/scripts/bacula-dir.conf.maxruntime.in >${cwd}/scripts/bacula-dir.conf.maxruntime
 sed -f ${out} ${cwd}/scripts/new-test-bacula-dir.conf.in >${cwd}/scripts/new-test-bacula-dir.conf
 sed -f ${out} ${cwd}/scripts/plugin-test-bacula-dir.conf.in >${cwd}/scripts/plugin-test-bacula-dir.conf
 sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf
diff --git a/regress/tests/maxruntime-test b/regress/tests/maxruntime-test
new file mode 100755 (executable)
index 0000000..0381095
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+#  Test MaxRunTime
+#  Note: this test doesn't really do anything yet. It is used in helping
+#    to duplicate bug #1268, but so far not successful ...
+#
+
+TestName="maxruntime-test"
+JobName=backup
+
+. scripts/functions
+
+copy_test_confs
+
+rm -f ${cwd}/tmp/RUN*log
+cp -f ${cwd}/scripts/bacula-dir.conf.maxruntime ${cwd}/bin/bacula-dir.conf
+WHEN=`date '+%Y-%m-%d %H:%M:%S'`
+
+echo "${cwd}/build/po" >${cwd}/tmp/file-list
+
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out ${cwd}/tmp/log1.out
+messages
+label volume=TestVolume001 pool=PoolA
+label volume=TestVolume002 pool=Default
+mount
+wait
+messages
+setdebug level=60 dir
+run job=RUN_MAXRUNTIME pool=PoolA yes
+wait
+messages
+st dir
+quit
+END_OF_DATA
+
+(mkfifo ${cwd}/tmp/fifo 
+ mkfifo ${cwd}/tmp/fifo2
+ mkfifo ${cwd}/tmp/fifo3) 2> /dev/null
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+rm -f ${cwd}/tmp/fifo ${cwd}/tmp/fifo2 ${cwd}/tmp/fifo3
+
+dstat=0
+bstat=0
+rstat=0
+touch ${cwd}/tmp/log2.out
+
+grep -e ': Fatal error: Max run time exceeded. Job canceled.' ${cwd}/tmp/log1.out >/dev/null 
+if [ $? -eq 0 ]
+then
+    [ "$debug" = 1 ] && echo MAXRUNTIME ok
+else
+   echo "MAXRUNTIME in error"
+   bstat=1
+fi
+
+end_test
index 5aa031e8487a1a8ecca235518eac51db97636817..c444cdc432c09e3ff2b61494a93df84feb744e84 100755 (executable)
@@ -26,6 +26,7 @@ label volume=TestVolume001 pool=PoolA
 @# no media => have to wait
 run job=RUN_MAXWAITTIME pool=Default yes
 @sleep 2
+wait
 @# storage is used by RUN_MAXWAITTIME => have to wait
 run job=RUN_MAXSTARTDELAY pool=PoolA when="$WHEN" yes
 @sleep 60
@@ -33,6 +34,7 @@ label volume=TestVolume002 pool=Default
 mount
 wait
 messages
+setdebug level=200 dir
 run job=RUN_MAXRUNTIME pool=PoolA yes
 wait
 messages
index 6563a9170f6a375fd2cde0c495fb2bc211bfdd12..9aea202d0990f5fba4643f27b9e0b019f789f514 100755 (executable)
@@ -5,7 +5,7 @@
 #
 # This script uses the virtual disk autochanger
 #
-TestName="virtual-backup-test"
+TestName="virtual-backup2-test"
 JobName=Vbackup
 . scripts/functions