From: Eric Bollengier Date: Sat, 5 May 2007 13:31:01 +0000 (+0000) Subject: ebl Add maxwaitime, maxruntime, maxstartdelay non-regression test X-Git-Tag: Release-2.2.0~576 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0c7e7d12926f89c7867ece9ab9cc218fa607d6d4;p=bacula%2Fbacula ebl Add maxwaitime, maxruntime, maxstartdelay non-regression test git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4704 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/bacula-dir.conf.maxtime.in b/regress/scripts/bacula-dir.conf.maxtime.in index 239d6d7790..88d1172f60 100644 --- a/regress/scripts/bacula-dir.conf.maxtime.in +++ b/regress/scripts/bacula-dir.conf.maxtime.in @@ -19,7 +19,7 @@ Director { # define myself WorkingDirectory = "@working_dir@" PidDirectory = "@piddir@" SubSysDirectory = "@subsysdir@" - Maximum Concurrent Jobs = 4 + Maximum Concurrent Jobs = 1 Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password Messages = Standard } @@ -50,7 +50,10 @@ FileSet { Options { read fifo = yes } + # wait 60s per fifo File=/tmp/fifo + File=/tmp/fifo2 + File=/tmp/fifo3 } } @@ -65,8 +68,9 @@ Job { Name = "RUN_MAXSTARTDELAY" JobDefs = DefaultJob FileSet = FS_TESTJOB - MaxStartDelay = 1min + MaxStartDelay = 30sec Pool = PoolA + # TODO: il faut un when= } Job { diff --git a/regress/tests/maxtime-test b/regress/tests/maxtime-test new file mode 100755 index 0000000000..685a40f866 --- /dev/null +++ b/regress/tests/maxtime-test @@ -0,0 +1,79 @@ +#!/bin/sh +# +# Test RunScript +# + +TestName="maxtime-test" +JobName=backup + +. scripts/functions +set_debug 0 +copy_test_confs + +rm -f bin/bacula-dir.conf +rm -f tmp/RUN*log +/bin/cp -f scripts/bacula-dir.conf.maxtime bin/bacula-dir.conf +WHEN=$(date '+%Y-%m-%d %H:%M:%S') + +echo "${cwd}/build/po" >/tmp/file-list + +start_test + +cat <tmp/bconcmds +@$out /dev/null +messages +label volume=TestVolume001 pool=PoolA +@$out tmp/RUN_MAXTIME.log +@# no media => have to wait +run job=RUN_MAXWAITTIME pool=Default yes +@sleep 2 +@# storage is used by RUN_MAXWAITTIME => have to wait +run job=RUN_MAXSTARTDELAY pool=PoolA when="$WHEN" yes +wait +messages +run job=RUN_MAXRUNTIME pool=PoolA yes +wait +messages +st dir +quit +END_OF_DATA + +(mkfifo /tmp/fifo + mkfifo /tmp/fifo2 + mkfifo /tmp/fifo3) 2> /dev/null + +bin/bacula start +cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf > /dev/null +stop_bacula + +rm /tmp/fifo /tmp/fifo2 /tmp/fifo3 + +export dstat=0 +export bstat=0 +export rstat=0 + +if grep -q -e 'RUN_MAXWAITTIME.* Fatal error: Max wait time exceeded. Job canceled.' tmp/RUN_MAXTIME.log +then + [ "$debug" = 1 ] && echo MAXWAITTIME ok +else + echo "MAXWAITTIME in error" + rstat=1 +fi + +if grep -q -e 'RUN_MAXSTARTDELAY.* Fatal error: Job canceled because max start delay time exceeded.' tmp/RUN_MAXTIME.log +then + [ "$debug" = 1 ] && echo MAXSTARTDELAY ok +else + echo "MAXSTARTDELAY in error" + rstat=1 +fi + +if grep -q -e 'RUN_MAXRUNTIME.* Fatal error: Max run time exceeded. Job canceled.' tmp/RUN_MAXTIME.log +then + [ "$debug" = 1 ] && echo MAXRUNTIME ok +else + echo "MAXRUNTIME in error" + rstat=1 +fi + +end_test \ No newline at end of file