]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bug-897
8377da23c711b9584c450f4423072c87ce05404f
[bacula/bacula] / regress / tests / bug-897
1 #!/bin/sh
2 #
3 #  Test bug 897
4 #
5
6 TestName="bug-897"
7 JobName=backup
8
9 . scripts/functions
10 copy_test_confs
11
12 rm -f bin/bacula-dir.conf
13 rm -f tmp/RUN*log
14 /bin/cp -f scripts/bacula-dir.conf.testrunscript bin/bacula-dir.conf
15
16 echo "${cwd}/build/po" >/tmp/file-list
17
18 start_test
19
20 cat <<END_OF_DATA >tmp/bconcmds
21 @$out /dev/null
22 messages
23 label volume=TestVolume001
24 @$out tmp/RUN_FD_WARNING.log
25 run job=RUN_FD_WARNING yes
26 wait
27 messages
28 @sleep 1
29 @$out tmp/RUN_FD_FAILED.log
30 run job=RUN_FD_FAILED yes
31 wait
32 messages
33 st dir
34 quit
35 END_OF_DATA
36
37 run_bacula
38 check_for_zombie_jobs storage=File
39 stop_bacula
40
41 dstat=0
42 bstat=0
43 rstat=0
44 export dstat
45 export bstat
46 export rstat
47
48 grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"' tmp/RUN_FD_FAILED.log >/dev/null 2>&1
49 a=$?
50 grep 'fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED2"' tmp/RUN_FD_FAILED.log >/dev/null 2>&1
51 b=$?
52 grep 'dir: AfterJob: run command "/bin/echo RunAfterFailedJob"' tmp/RUN_FD_FAILED.log >/dev/null 2>&1
53 c=$?
54 grep 'touching' tmp/RUN_FD_FAILED.log >/dev/null 2>&1
55 d=$?
56 grep '*** Backup Error ***' tmp/RUN_FD_FAILED.log >/dev/null 2>&1
57 e=$?
58 if [ $a = 0 -a $b = 0 -a $c = 0 -a $d = 0 -a $e = 0 ]
59 then
60    [ "$debug" = 1 ] && echo RUN_FD_FAILED ok
61 else
62    echo "RUN_FD_FAILED in error"
63    rstat=1
64 fi
65
66 end_test