]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/allowcompress-test
regress: fix delete-test
[bacula/bacula] / regress / tests / allowcompress-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed option
4 #   then restore it.  Then do the same against the second storage, File1, which 
5 #   has AllowCompression=No set.
6 #
7 TestName="allowcompress-test"
8 JobName=compressed
9 . scripts/functions
10
11 scripts/cleanup
12 scripts/copy-test-confs
13 echo "${cwd}/build" >${cwd}/tmp/file-list
14
15 outf="tmp/sed_tmp"
16 echo "s/FileStorage$/FileStorage; AllowCompression=no/" > $outf
17 cp $scripts/bacula-dir.conf $tmp/1
18 sed -f ${outf} ${cwd}/tmp/1 > $scripts/bacula-dir.conf 
19
20 change_jobname CompressedTest $JobName
21 start_test
22       
23 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
24 @$out /dev/null
25 messages
26 @$out ${cwd}/tmp/log1.out
27 messages
28 label storage=File volume=TestVolume001
29 run level=Full job=$JobName storage=File yes
30 wait
31 messages
32 @# 
33 @# now do a restore
34 @#
35 @$out ${cwd}/tmp/log2.out
36 restore where=${cwd}/tmp/bacula-restores select storage=File
37 unmark *
38 mark *
39 done
40 yes
41 wait
42 messages
43 @$out ${cwd}/tmp/log3.out
44 messages
45 label storage=File1 volume=TestVolume002
46 run level=Full job=$JobName storage=File1 yes
47 wait
48 messages
49 @# 
50 @# now do a restore
51 @#
52 @$out ${cwd}/tmp/log2.out
53 restore where=${cwd}/tmp/bacula-restores select storage=File1
54 unmark *
55 mark *
56 done
57 yes
58 wait
59 quit
60 END_OF_DATA
61
62 run_bacula
63 check_for_zombie_jobs storage=File
64 stop_bacula
65
66 check_two_logs
67 check_restore_diff
68 grep " Software Compression" ${cwd}/tmp/log3.out | grep "None" 2>&1 1>/dev/null
69 if [ $? = 0 ] ; then
70    echo "  !!!!! No Compression when AllowCompression=yes is set !!!!!"
71    bstat=1
72 fi
73
74 end_test