3 # Test if Bacula can automatically create a Volume label.
6 TestName="runscript-test"
12 rm -f bin/bacula-dir.conf
13 /bin/cp -f scripts/bacula-dir.conf.testrunscript bin/bacula-dir.conf
15 echo "${cwd}/build" >/tmp/file-list
19 cat <<END_OF_DATA >tmp/bconcmds
22 label volume=TestVolume001
23 @#setdebug level=100 storage=File
24 @output tmp/log.RUN_ALL_OK.out
25 run job=RUN_ALL_OK yes
29 @output tmp/log.RUN_DIR_FAILED.out
30 run job=RUN_DIR_FAILED yes
34 @output tmp/log.RUN_FD_FAILED.out
35 run job=RUN_FD_FAILED yes
39 @output tmp/log.RUN_FD_WARNING.out
40 run job=RUN_FD_WARNING yes
51 if grep -q 'dir: BeforeJob: run command "/bin/echo RunBeforeJob"' tmp/log.RUN_ALL_OK.out &&
52 grep -q 'fd: ClientRunBeforeJob: ClientRunBeforeJob' tmp/log.RUN_ALL_OK.out &&
53 grep -q 'fd: ClientAfterJob: run command "/bin/echo ClientRunAfterJob' tmp/log.RUN_ALL_OK.out &&
54 grep -q 'dir: AfterJob: run command "/bin/echo RunAfterJob' tmp/log.RUN_ALL_OK.out
56 [ "$debug" -eq 1 ] && echo RUN_ALL_OK ok
58 echo "RUN_ALL_OK in error"
62 if grep -q 'dir: BeforeJob: run command "/bin/false"' tmp/log.RUN_DIR_FAILED.out &&
63 grep -q 'dir: BeforeJob: RunAfterFailedJob' tmp/log.RUN_DIR_FAILED.out &&
64 true # grep -q 'Backup OK -- with warnings' tmp/log.RUN_DIR_FAILED.out
66 [ "$debug" -eq 1 ] && echo RUN_DIR_FAILED ok
68 echo "RUN_DIR_FAILED in error"
72 if grep -q 'fd: ClientBeforeJob: run command "/bin/false"' tmp/log.RUN_FD_FAILED.out &&
73 grep -q 'fd: ClientBeforeJob: run command "/bin/false 2"' tmp/log.RUN_FD_FAILED.out &&
74 grep -q 'dir: AfterJob: run command "/bin/echo RunAfterFailedJob"' tmp/log.RUN_FD_FAILED.out
76 [ "$debug" -eq 1 ] && echo RUN_FD_FAILED ok
78 echo "RUN_FD_FAILED in error"
82 if grep -q 'fd: ClientBeforeJob: run command "/bin/false"' tmp/log.RUN_FD_WARNING.out &&
83 grep -q 'Backup OK -- with warnings' tmp/log.RUN_FD_WARNING.out
85 [ "$debug" -eq 1 ] && echo RUN_FD_WARNING ok
87 echo "RUN_FD_WARNING in error"