3 # Test MaxWaitTime, MaxRunTime and MaxStartDelay
6 TestName="maxtime-test"
13 rm -f bin/bacula-dir.conf
14 rm -f ${cwd}/tmp/RUN*log
15 /bin/cp -f scripts/bacula-dir.conf.maxtime bin/bacula-dir.conf
16 WHEN=`date '+%Y-%m-%d %H:%M:%S'`
18 echo "${cwd}/build/po" >${cwd}/tmp/file-list
22 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
25 label volume=TestVolume001 pool=PoolA
26 @$out ${cwd}/tmp/RUN_MAXTIME.log
27 @# no media => have to wait
28 run job=RUN_MAXWAITTIME pool=Default yes
30 @# storage is used by RUN_MAXWAITTIME => have to wait
31 run job=RUN_MAXSTARTDELAY pool=PoolA when="$WHEN" yes
34 run job=RUN_MAXRUNTIME pool=PoolA yes
41 (mkfifo ${cwd}/tmp/fifo
42 mkfifo ${cwd}/tmp/fifo2
43 mkfifo ${cwd}/tmp/fifo3) 2> /dev/null
48 rm ${cwd}/tmp/fifo ${cwd}/tmp/fifo2 ${cwd}/tmp/fifo3
54 grep -e '1: Fatal error: Max wait time exceeded. Job canceled.' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null
57 [ "$debug" = 1 ] && echo MAXWAITTIME ok
59 echo "MAXWAITTIME in error"
63 grep -e '2: Fatal error: Job canceled because max start delay time exceeded.' ${cwd}/tmp/RUN_MAXTIME.log > /dev/null
66 grep -e 'NEVER start this' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null
69 if [ $f -eq 0 -a $s -ne 0 ]
71 [ "$debug" = 1 ] && echo MAXSTARTDELAY ok
73 echo "MAXSTARTDELAY in error"
77 grep -e '3: Fatal error: Max run time exceeded. Job canceled.' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null
80 [ "$debug" = 1 ] && echo MAXRUNTIME ok
82 echo "MAXRUNTIME in error"