]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/messages-saved-test
Big backport from Enterprise
[bacula/bacula] / regress / tests / messages-saved-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Run a simple backup of the Bacula build directory
7 # See if we have the list of files backed up in a log
8 #
9 #
10 TestName="messages-saved-test"
11 JobName=backup
12 . scripts/functions
13
14 scripts/cleanup
15 scripts/copy-confs
16 change_jobname BackupClient1 $JobName
17 start_test
18
19 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "ClientRunBeforeJob", "echo this is a test", "Job", "backup")'
20 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "ClientRunAfterJob", "echo this is a test", "Job", "backup")'
21 $bperl -e 'add_attribute("$conf/bacula-fd.conf", "Append", "$tmp/fd.log = All, Saved", "Messages", "Standard")'
22
23 cat <<END_OF_DATA >$tmp/bconcmds
24 @output /dev/null
25 messages
26 @$out $tmp/log1.out
27 @#setdebug level=100 storage=File
28 label volume=TestVolume001 storage=File1 pool=File drive=0 slot=0
29 run job=$JobName yes
30 @sleep 1
31 status storage=File1
32 wait
33 messages
34 quit
35 END_OF_DATA
36
37 run_bacula
38 check_for_zombie_jobs storage=File
39 stop_bacula
40
41 nb=`cat $tmp/fd.log | wc -l`
42 if [ $nb -lt 1000 ]; then
43     print_debug "ERROR: Not enough line in $tmp/fd.log"
44     estat=1
45 fi
46
47 grep po/fr.po $tmp/fd.log > /dev/null
48 if [ $? -ne 0 ]; then
49     print_debug "ERROR: Should find po/fr.po in $tmp/fd.log"
50     estat=1
51 fi
52
53 grep "ClientRunBeforeJob: this is a test" $tmp/fd.log > /dev/null
54 if [ $? -ne 0 ]; then
55     print_debug "ERROR: Should runscript output in $tmp/fd.log"
56     estat=1
57 fi
58
59 end_test