From 9e9cb5c143876c2716a3352e78ddfa4930925cae Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 12 Nov 2006 23:11:37 +0000 Subject: [PATCH] ebl add runscript regression script (not yet works well) git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3612 91ce42f0-d328-0410-95d8-f526ca767f89 --- .../scripts/bacula-dir.conf.testrunscript.in | 192 ++++++++++++++++++ regress/tests/runscript-test | 90 ++++++++ 2 files changed, 282 insertions(+) create mode 100644 regress/scripts/bacula-dir.conf.testrunscript.in create mode 100755 regress/tests/runscript-test diff --git a/regress/scripts/bacula-dir.conf.testrunscript.in b/regress/scripts/bacula-dir.conf.testrunscript.in new file mode 100644 index 0000000000..5f1b13cda0 --- /dev/null +++ b/regress/scripts/bacula-dir.conf.testrunscript.in @@ -0,0 +1,192 @@ +# +# Default Bacula Director Configuration file +# +# The only thing that MUST be changed is to add one or more +# file or directory names in the Include directive of the +# FileSet resource. +# +# For Bacula release 1.39.27 (24 October 2006) -- debian testing/unstable +# +# You might also want to change the default email address +# from root to your address. See the "mail" and "operator" +# directives in the Messages resource. +# + +Director { # define myself + Name = @hostname@-dir + DIRport = 8101 # where we listen for UA connections + QueryFile = "@scriptdir@/query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@piddir@" + SubSysDirectory = "@subsysdir@" + Maximum Concurrent Jobs = 4 + Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password + Messages = Daemon +} + +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = @hostname@-fd + FileSet = FS_TESTJOB + Storage = File + Messages = Standard + Pool = Default + Priority = 10 + Maximum Concurrent Jobs = 16 +} + +FileSet { + Name = FS_TESTJOB + Include { + File=/tmp/file-list + +start_test + +cat <tmp/bconcmds +@output /dev/null +messages +label volume=TestVolume001 +@#setdebug level=100 storage=File +@output tmp/log.RUN_ALL_OK.out +run job=RUN_ALL_OK yes +wait +@sleep 5 +messages +@output tmp/log.RUN_DIR_FAILED.out +run job=RUN_DIR_FAILED yes +wait +@sleep 5 +messages +@output tmp/log.RUN_FD_FAILED.out +run job=RUN_FD_FAILED yes +wait +@sleep 5 +messages +@output tmp/log.RUN_FD_WARNING.out +run job=RUN_FD_WARNING yes +wait +@sleep 5 +messages +st dir +quit +END_OF_DATA + +run_bacula +stop_bacula + +if grep -q 'dir: BeforeJob: run command "/bin/echo RunBeforeJob"' tmp/log.RUN_ALL_OK.out && + grep -q 'fd: ClientRunBeforeJob: ClientRunBeforeJob' tmp/log.RUN_ALL_OK.out && + grep -q 'fd: ClientAfterJob: run command "/bin/echo ClientRunAfterJob' tmp/log.RUN_ALL_OK.out && + grep -q 'dir: AfterJob: run command "/bin/echo RunAfterJob' tmp/log.RUN_ALL_OK.out +then + [ "$debug" -eq 1 ] && echo RUN_ALL_OK ok +else + echo "RUN_ALL_OK in error" + rstat=1 +fi + +if grep -q 'dir: BeforeJob: run command "/bin/false"' tmp/log.RUN_DIR_FAILED.out && + grep -q 'dir: BeforeJob: RunAfterFailedJob' tmp/log.RUN_DIR_FAILED.out && + true # grep -q 'Backup OK -- with warnings' tmp/log.RUN_DIR_FAILED.out +then + [ "$debug" -eq 1 ] && echo RUN_DIR_FAILED ok +else + echo "RUN_DIR_FAILED in error" + rstat=1 +fi + +if grep -q 'fd: ClientBeforeJob: run command "/bin/false"' tmp/log.RUN_FD_FAILED.out && + grep -q 'fd: ClientBeforeJob: run command "/bin/false 2"' tmp/log.RUN_FD_FAILED.out && + grep -q 'dir: AfterJob: run command "/bin/echo RunAfterFailedJob"' tmp/log.RUN_FD_FAILED.out +then + [ "$debug" -eq 1 ] && echo RUN_FD_FAILED ok +else + echo "RUN_FD_FAILED in error" + rstat=1 +fi + +if grep -q 'fd: ClientBeforeJob: run command "/bin/false"' tmp/log.RUN_FD_WARNING.out && + grep -q 'Backup OK -- with warnings' tmp/log.RUN_FD_WARNING.out +then + [ "$debug" -eq 1 ] && echo RUN_FD_WARNING ok +else + echo "RUN_FD_WARNING in error" + rstat=1 +fi + -- 2.39.5