From 11a5bab6a362e4f41860db10c417121484fc0157 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 16 Sep 2008 20:51:59 +0000 Subject: [PATCH] ebl Add multiple command test for runscript git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7605 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/scripts/bacula-dir.conf.testrunscript.in | 9 +++++++++ regress/tests/runscript-test | 11 +++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/regress/scripts/bacula-dir.conf.testrunscript.in b/regress/scripts/bacula-dir.conf.testrunscript.in index b6a4042d56..b2cab97a70 100644 --- a/regress/scripts/bacula-dir.conf.testrunscript.in +++ b/regress/scripts/bacula-dir.conf.testrunscript.in @@ -57,6 +57,13 @@ Job { ClientRunBeforeJob = "/bin/echo ClientRunBeforeJob" Run After Job = "/bin/echo RunAfterJob" ClientRunAfterJob = "/bin/echo ClientRunAfterJob" + RunScript { + Command = "/bin/echo ClientRunBefore1" + Command = "/bin/echo ClientRunBefore2" + Command = "/bin/echo ClientRunBefore3" + Command = "/bin/echo ClientRunBefore4" + RunsWhen = Before + } } Job { @@ -105,6 +112,7 @@ Job { } RunScript { Command = "/bin/false RUN_FD_FAILED3" + Command = "/bin/false RUN_FD_FAILED4" failjobonerror = yes RunsWhen = Before } @@ -171,6 +179,7 @@ Job { Console = "purge volume=TestVolume001 yes" Console = "st dir" RunsWhen = Before + failjobonerror = no runsonclient = no } } diff --git a/regress/tests/runscript-test b/regress/tests/runscript-test index cd53433e15..144a9276a0 100755 --- a/regress/tests/runscript-test +++ b/regress/tests/runscript-test @@ -76,7 +76,12 @@ grep 'shell command: run ClientAfterJob "/bin/echo ClientRunAfterJob' ${cwd}/tmp c=$? grep 'shell command: run AfterJob "/bin/echo RunAfterJob' ${cwd}/tmp/RUN_ALL_OK.log >/dev/null d=$? -if [ $a = 0 -a $b = 0 -a $c = 0 -a $d = 0 ] +grep 'ClientRunBefore1' ${cwd}/tmp/RUN_ALL_OK.log >/dev/null && \ +grep 'ClientRunBefore2' ${cwd}/tmp/RUN_ALL_OK.log >/dev/null && \ +grep 'ClientRunBefore3' ${cwd}/tmp/RUN_ALL_OK.log >/dev/null +e=$? + +if [ $a = 0 -a $b = 0 -a $c = 0 -a $d = 0 -a $e = 0 ] then [ "$debug" = 1 ] && echo RUN_ALL_OK ok else @@ -126,7 +131,9 @@ grep 'shell command: run AfterJob "/bin/echo RunAfterFailedJob"' ${cwd}/tmp/RUN_ d=$? grep '*** Backup Error ***' ${cwd}/tmp/RUN_FD_FAILED2.log >/dev/null e=$? -if [ $a = 0 -a $b != 0 -a $c = 0 -a $d = 0 -a $e = 0 ] +grep 'RUN_FD_FAILED4' ${cwd}/tmp/RUN_FD_FAILED2.log >/dev/null +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 -- 2.39.5