X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fmaxtime-test;h=5aa031e8487a1a8ecca235518eac51db97636817;hb=b3d16d6c193ef2f61f7cc3fbefc72a8c8b1b79d8;hp=685a40f8669284debb88cfd91e125faf4f18d5b8;hpb=0c7e7d12926f89c7867ece9ab9cc218fa607d6d4;p=bacula%2Fbacula diff --git a/regress/tests/maxtime-test b/regress/tests/maxtime-test index 685a40f866..5aa031e848 100755 --- a/regress/tests/maxtime-test +++ b/regress/tests/maxtime-test @@ -1,34 +1,36 @@ #!/bin/sh # -# Test RunScript +# Test MaxWaitTime, MaxRunTime and MaxStartDelay # 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') +rm -f ${cwd}/tmp/RUN*log +cp -f ${cwd}/scripts/bacula-dir.conf.maxtime ${cwd}/bin/bacula-dir.conf +WHEN=`date '+%Y-%m-%d %H:%M:%S'` -echo "${cwd}/build/po" >/tmp/file-list +echo "${cwd}/build/po" >${cwd}/tmp/file-list start_test -cat <tmp/bconcmds -@$out /dev/null +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log1.out messages label volume=TestVolume001 pool=PoolA -@$out tmp/RUN_MAXTIME.log +@$out ${cwd}/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 +@sleep 60 +label volume=TestVolume002 pool=Default +mount wait messages run job=RUN_MAXRUNTIME pool=PoolA yes @@ -38,42 +40,51 @@ st dir quit END_OF_DATA -(mkfifo /tmp/fifo - mkfifo /tmp/fifo2 - mkfifo /tmp/fifo3) 2> /dev/null +(mkfifo ${cwd}/tmp/fifo + mkfifo ${cwd}/tmp/fifo2 + mkfifo ${cwd}/tmp/fifo3) 2> /dev/null -bin/bacula start -cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf > /dev/null +run_bacula +check_for_zombie_jobs storage=File stop_bacula -rm /tmp/fifo /tmp/fifo2 /tmp/fifo3 +rm -f ${cwd}/tmp/fifo ${cwd}/tmp/fifo2 ${cwd}/tmp/fifo3 -export dstat=0 -export bstat=0 -export rstat=0 +dstat=0 +bstat=0 +rstat=0 +touch ${cwd}/tmp/log2.out -if grep -q -e 'RUN_MAXWAITTIME.* Fatal error: Max wait time exceeded. Job canceled.' tmp/RUN_MAXTIME.log +grep -e '1: Fatal error: Max wait time exceeded. Job canceled.' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null +if [ $? -eq 0 ] then [ "$debug" = 1 ] && echo MAXWAITTIME ok else echo "MAXWAITTIME in error" - rstat=1 + bstat=1 fi -if grep -q -e 'RUN_MAXSTARTDELAY.* Fatal error: Job canceled because max start delay time exceeded.' tmp/RUN_MAXTIME.log +grep -e '2: Fatal error: Job canceled because max start delay time exceeded.' ${cwd}/tmp/RUN_MAXTIME.log > /dev/null +f=$? + +grep -e 'NEVER start this' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null +s=$? + +if [ $f -eq 0 -a $s -ne 0 ] then [ "$debug" = 1 ] && echo MAXSTARTDELAY ok else echo "MAXSTARTDELAY in error" - rstat=1 + bstat=1 fi -if grep -q -e 'RUN_MAXRUNTIME.* Fatal error: Max run time exceeded. Job canceled.' tmp/RUN_MAXTIME.log +grep -e '3: Fatal error: Max run time exceeded. Job canceled.' ${cwd}/tmp/RUN_MAXTIME.log >/dev/null +if [ $? -eq 0 ] then [ "$debug" = 1 ] && echo MAXRUNTIME ok else echo "MAXRUNTIME in error" - rstat=1 + bstat=1 fi -end_test \ No newline at end of file +end_test