]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/messages-test
Backport from BEE
[bacula/bacula] / regress / tests / messages-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 # We have bad configuration for Messages resources, everything
6 # should work
7 #
8 TestName="messages-test"
9 JobName=backup
10 . scripts/functions
11
12 # turn off until the email problem is solved
13 exit 0
14
15 scripts/cleanup
16 scripts/copy-confs
17 change_jobname BackupClient1 $JobName
18 start_test
19 #
20 # Zap out any schedule in default conf file so that
21 #  it doesn't start during our test
22 #
23 outf="$tmp/sed_tmp"
24 echo "s%  Schedule =%# Schedule =%g" >$outf
25
26 # tweak all Messages {} with non valid path
27 echo 's%append = "%append = "/nowhere%g' >> $outf
28 echo "s%bsmtp -h $SMTP_HOST%bsmtp -h nonvalidhost%g" >> $outf
29 echo 's%# mail%  mail%' >> $outf
30 echo 's%Bacula daemon message%DELETE THIS MESSAGE Bacula daemon message%' >> $outf
31 echo 's%Bacula:%DELETE THIS MESSAGE Bacula:%' >> $outf
32 #echo 's%mailcommand = "%mailcommand = "/nowhere%g' >> $outf
33
34 cp $scripts/bacula-dir.conf $tmp/1
35 sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf
36
37
38 cat <<END_OF_DATA >$tmp/bconcmds
39 @$out /dev/null
40 messages
41 @$out $tmp/log1.out
42 @#setdebug level=100 storage=File
43 label volume=TestVolume001 storage=File pool=File
44 run job=$JobName yes
45 @sleep 1
46 status storage=File
47 wait
48 messages
49 @# 
50 @# now do a restore
51 @#
52 @$out $tmp/log2.out  
53 restore where=$tmp/bacula-restores select all done
54 yes
55 wait
56 messages
57 quit
58 END_OF_DATA
59
60 run_bacula
61 check_for_zombie_jobs storage=File
62 stop_bacula
63
64 check_two_logs
65 check_restore_diff
66 end_test