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