3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
9 # Note: this test doesn't really do anything yet. It is used in helping
10 # to duplicate bug #1268, but so far not successful ...
13 TestName="maxruntime-test"
20 rm -f ${cwd}/tmp/RUN*log
21 cp -f ${cwd}/scripts/bacula-dir.conf.maxruntime ${cwd}/bin/bacula-dir.conf
22 WHEN=`date '+%Y-%m-%d %H:%M:%S'`
24 echo "${cwd}/build" >${cwd}/tmp/file-list
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @$out ${cwd}/tmp/log1.out
31 label volume=TestVolume001 pool=PoolA
32 label volume=TestVolume002 pool=Default
37 run job=RUN_MAXRUNTIME pool=PoolA yes
38 run job=RUN_MAXRUNTIME fileset=FS_TESTJOB pool=PoolA yes
45 (mkfifo ${cwd}/tmp/fifo
46 mkfifo ${cwd}/tmp/fifo2
47 mkfifo ${cwd}/tmp/fifo3) 2> /dev/null
50 check_for_zombie_jobs storage=File
53 rm -f ${cwd}/tmp/fifo ${cwd}/tmp/fifo2 ${cwd}/tmp/fifo3
58 touch ${cwd}/tmp/log2.out
60 grep -e ': Fatal error: Max run time exceeded. Job canceled.' ${cwd}/tmp/log1.out >/dev/null
63 [ "$debug" = 1 ] && echo MAXRUNTIME ok
65 echo "MAXRUNTIME in error"
69 nb=`grep -e ': Fatal error: Max run time exceeded. Job canceled.' ${cwd}/tmp/log1.out | wc -l`
72 [ "$debug" = 1 ] && echo MAXRUNTIME ok
74 echo "MAXRUNTIME in error, should not cancel the second job"