X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fbug-897;h=67d0c2f2bb8143c0abb65a31910bef32f525cf43;hb=12b8fd96780583d7393c5e851f81a00ba653e347;hp=8377da23c711b9584c450f4423072c87ce05404f;hpb=e4514a8777b6e6de60f4020482ab9f47a21e0e41;p=bacula%2Fbacula diff --git a/regress/tests/bug-897 b/regress/tests/bug-897 index 8377da23c7..67d0c2f2bb 100755 --- a/regress/tests/bug-897 +++ b/regress/tests/bug-897 @@ -10,24 +10,40 @@ JobName=backup copy_test_confs rm -f bin/bacula-dir.conf -rm -f tmp/RUN*log +rm -f ${cwd}/tmp/RUN*log +rm -f ${cwd}/tmp/fifo +rm -f ${cwd}/tmp/RUN_BUG_897 +rm -f ${cwd}/tmp/RUN_FD_FAILED + /bin/cp -f scripts/bacula-dir.conf.testrunscript bin/bacula-dir.conf -echo "${cwd}/build/po" >/tmp/file-list +echo "${cwd}/build/po" >${cwd}/tmp/file-list +echo "${cwd}/tmp/fifo" >> ${cwd}/tmp/file-list +mkfifo "${cwd}/tmp/fifo" + +# use this to be able to cancel a running job +( + cat > ${cwd}/tmp/fifo < /dev/zero + cat > ${cwd}/tmp/fifo < /dev/zero +) & start_test -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @$out /dev/null messages label volume=TestVolume001 -@$out tmp/RUN_FD_WARNING.log -run job=RUN_FD_WARNING yes +@$out ${cwd}/tmp/RUN_FD_FAILED.log +run job=RUN_FD_FAILED yes wait messages @sleep 1 -@$out tmp/RUN_FD_FAILED.log -run job=RUN_FD_FAILED yes +@$out ${cwd}/tmp/RUN_BUG_897.log +setdebug level=200 client +run job=BUG_897 yes +@sleep 2 +cancel +yes wait messages st dir @@ -45,15 +61,15 @@ export dstat export bstat export rstat -grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"' tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 a=$? -grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED2"' tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED2"' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 b=$? -grep 'dir: AfterJob: run command "/bin/echo RunAfterFailedJob"' tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +grep 'dir: AfterJob: run command "/bin/echo RunAfterFailedJob"' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 c=$? -grep 'touching' tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +grep 'touching' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 d=$? -grep '*** Backup Error ***' tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +grep '*** Backup Error ***' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 e=$? if [ $a = 0 -a $b = 0 -a $c = 0 -a $d = 0 -a $e = 0 ] then @@ -62,5 +78,28 @@ else echo "RUN_FD_FAILED in error" rstat=1 fi +if test -f ${cwd}/tmp/RUN_FD_FAILED +then + echo "The ${cwd}/tmp/RUN_FD_FAILED have been created, but nothing could be found" + echo "in the log" +fi + + +grep 'touching' ${cwd}/tmp/RUN_BUG_897.log >/dev/null 2>&1 +d=$? +if [ $d = 0 ] +then + [ "$debug" = 1 ] && echo RUN_FD_FAILED ok +else + echo "RUN_BUG_897 in error" + rstat=1 +fi +if test -f ${cwd}/tmp/RUN_BUG_897 +then + echo "The ${cwd}/tmp/RUN_BUG_897 have been created, but nothing could be found" + echo "in the log" +fi + + end_test