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
47 rm ${cwd}/tmp/fifo ${cwd}/tmp/fifo2 ${cwd}/tmp/fifo3
53 grep -e '1: Fatal error: Max wait time exceeded. Job canceled.' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null
56 [ "$debug" = 1 ] && echo MAXWAITTIME ok
58 echo "MAXWAITTIME in error"
62 grep -e '2: Fatal error: Job canceled because max start delay time exceeded.' ${cwd}/tmp/RUN_MAXTIME.log > /dev/null
65 grep -e 'NEVER start this' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null
68 if [ $f -eq 0 -a $s -ne 0 ]
70 [ "$debug" = 1 ] && echo MAXSTARTDELAY ok
72 echo "MAXSTARTDELAY in error"
76 grep -e '3: Fatal error: Max run time exceeded. Job canceled.' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null
79 [ "$debug" = 1 ] && echo MAXRUNTIME ok
81 echo "MAXRUNTIME in error"