X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Frunscript-test;h=3f15cb6444e61ded17132174c87de896c4a5ebd8;hb=ad3c10917d42eaf60ec218b2d4614e49f1f25f34;hp=490af4e9064badd1c5abdd44a1933fab50aa03f1;hpb=9386fd6f7fb547c16ce11295f6052859e16a2c6b;p=bacula%2Fbacula diff --git a/regress/tests/runscript-test b/regress/tests/runscript-test index 490af4e906..3f15cb6444 100755 --- a/regress/tests/runscript-test +++ b/regress/tests/runscript-test @@ -10,38 +10,41 @@ 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/RUN_FD_FAILED + +touch ${cwd}/tmp/log1.out /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 start_test -cat <tmp/bconcmds +cat <${cwd}/tmp/bconcmds @$out /dev/null messages label volume=TestVolume001 -@$out tmp/RUN_FD_WARNING.log +@$out ${cwd}/tmp/RUN_FD_WARNING.log run job=RUN_FD_WARNING yes wait messages @sleep 1 -@$out tmp/RUN_ALL_OK.log +@$out ${cwd}/tmp/RUN_ALL_OK.log run job=RUN_ALL_OK yes wait messages @sleep 1 -@$out tmp/RUN_FD_FAILED.log +@$out ${cwd}/tmp/RUN_FD_FAILED.log run job=RUN_FD_FAILED yes wait messages @sleep 1 -@$out tmp/RUN_DIR_FAILED.log +@$out ${cwd}/tmp/RUN_DIR_FAILED.log run job=RUN_DIR_FAILED yes wait messages @sleep 1 -@$out tmp/RUN_FD_FAILED2.log +@$out ${cwd}/tmp/RUN_FD_FAILED2.log run job=RUN_FD_FAILED2 yes wait messages @@ -49,9 +52,8 @@ st dir quit END_OF_DATA - -bin/bacula start -cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf > /dev/null +run_bacula +check_for_zombie_jobs storage=File stop_bacula dstat=0 @@ -61,13 +63,13 @@ export dstat export bstat export rstat -grep 'dir: BeforeJob: run command "/bin/echo RunBeforeJob"' tmp/RUN_ALL_OK.log >/dev/null 2>&1 +grep 'shell command: run BeforeJob "/bin/echo RunBeforeJob"' ${cwd}/tmp/RUN_ALL_OK.log >/dev/null 2>&1 a=$? -grep 'fd: ClientRunBeforeJob: ClientRunBeforeJob' tmp/RUN_ALL_OK.log >/dev/null 2>&1 +grep 'ClientRunBeforeJob: ClientRunBeforeJob' ${cwd}/tmp/RUN_ALL_OK.log >/dev/null 2>&1 b=$? -grep 'fd: ClientAfterJob: run command "/bin/echo ClientRunAfterJob' tmp/RUN_ALL_OK.log >/dev/null 2>&1 +grep 'shell command: run ClientAfterJob "/bin/echo ClientRunAfterJob' ${cwd}/tmp/RUN_ALL_OK.log >/dev/null 2>&1 c=$? -grep 'dir: AfterJob: run command "/bin/echo RunAfterJob' tmp/RUN_ALL_OK.log >/dev/null 2>&1 +grep 'shell command: run AfterJob "/bin/echo RunAfterJob' ${cwd}/tmp/RUN_ALL_OK.log >/dev/null 2>&1 d=$? if [ $a = 0 -a $b = 0 -a $c = 0 -a $d = 0 ] then @@ -77,9 +79,9 @@ else rstat=1 fi -grep 'dir: BeforeJob: run command "/bin/false RUN_DIR_FAILED"' tmp/RUN_DIR_FAILED.log >/dev/null 2>&1 +grep 'shell command: run BeforeJob "/bin/false RUN_DIR_FAILED"' ${cwd}/tmp/RUN_DIR_FAILED.log >/dev/null 2>&1 a=$? -grep 'dir: AfterJob: RunAfterFailedJob' tmp/RUN_DIR_FAILED.log >/dev/null 2>&1 +grep 'AfterJob: RunAfterFailedJob' ${cwd}/tmp/RUN_DIR_FAILED.log >/dev/null 2>&1 b=$? if [ $a = 0 -a $b = 0 ] then @@ -89,45 +91,49 @@ else rstat=1 fi -grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"' tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +grep 'shell command: run ClientBeforeJob "/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 'shell command: run ClientBeforeJob "/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 'shell command: run ClientBeforeJob "/bin/false RUN_FD_FAILED3"' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 c=$? -grep '*** Backup Error ***' tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +grep 'shell command: run AfterJob "/bin/echo RunAfterFailedJob"' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 d=$? -if [ $a = 0 -a $b = 0 -a $c = 0 -a $d = 0 ] +grep 'touching' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +e=$? +grep '*** Backup Error ***' ${cwd}/tmp/RUN_FD_FAILED.log >/dev/null 2>&1 +f=$? +if [ $a = 0 -a $b = 0 -a $c = 0 -a $d = 0 -a $e = 0 -a $f = 0 ] then [ "$debug" = 1 ] && echo RUN_FD_FAILED ok else - echo "RUN_FD_FAILED in error" + echo "RUN_FD_FAILED in error a=$a b=$b c=$c d=$d e=$e f=$f" rstat=1 fi -grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"' tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 +grep 'shell command: run ClientBeforeJob "/bin/false RUN_FD_FAILED1"' ${cwd}/tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 a=$? -grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED2"' tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 +grep 'shell command: run ClientBeforeJob "/bin/false RUN_FD_FAILED2"' ${cwd}/tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 b=$? -grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED3"' tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 +grep 'shell command: run ClientBeforeJob "/bin/false RUN_FD_FAILED3"' ${cwd}/tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 c=$? -grep 'dir: AfterJob: run command "/bin/echo RunAfterFailedJob"' tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 +grep 'shell command: run AfterJob "/bin/echo RunAfterFailedJob"' ${cwd}/tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 d=$? -grep '*** Backup Error ***' tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 +grep '*** Backup Error ***' ${cwd}/tmp/RUN_FD_FAILED2.log >/dev/null 2>&1 e=$? if [ $a = 0 -a $b != 0 -a $c = 0 -a $d = 0 -a $e = 0 ] then [ "$debug" = 1 ] && echo RUN_FD_FAILED ok else - echo "RUN_FD_FAILED2 in error" + echo "RUN_FD_FAILED2 in error a=$a b=$b c=$d d=$d e=$e" rstat=1 fi -grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_WARNING"' tmp/RUN_FD_WARNING.log >/dev/null 2>&1 +grep 'shell command: run ClientBeforeJob "/bin/false RUN_FD_WARNING"' ${cwd}/tmp/RUN_FD_WARNING.log >/dev/null 2>&1 a=$? -grep 'RunAfterFailedJob' tmp/RUN_FD_WARNING.log >/dev/null 2>&1 +grep 'RunAfterFailedJob' ${cwd}/tmp/RUN_FD_WARNING.log >/dev/null 2>&1 b=$? -grep 'Backup OK -- with warnings' tmp/RUN_FD_WARNING.log >/dev/null 2>&1 +grep 'Backup OK -- with warnings' ${cwd}/tmp/RUN_FD_WARNING.log >/dev/null 2>&1 c=$? if [ $a = 0 -a $b != 0 -a $c = 0 ] then