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
46 cat ${cwd}/tmp/bconcmds | bin/bconsole -c bin/bconsole.conf > /dev/null
49 rm ${cwd}/tmp/fifo ${cwd}/tmp/fifo2 ${cwd}/tmp/fifo3
55 if grep -e 'RUN_MAXWAITTIME.* Fatal error: Max wait time exceeded. Job canceled.' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null 2>&1
57 [ "$debug" = 1 ] && echo MAXWAITTIME ok
59 echo "MAXWAITTIME in error"
63 if grep -e 'RUN_MAXSTARTDELAY.* Fatal error: Job canceled because max start delay time exceeded.' ${cwd}/tmp/RUN_MAXTIME.log &&
64 ! grep -e 'NEVER start this' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null 2>&1
66 [ "$debug" = 1 ] && echo MAXSTARTDELAY ok
68 echo "MAXSTARTDELAY in error"
72 if grep -e 'RUN_MAXRUNTIME.* Fatal error: Max run time exceeded. Job canceled.' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null 2>&1
74 [ "$debug" = 1 ] && echo MAXRUNTIME ok
76 echo "MAXRUNTIME in error"