]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/small-file-size-tape
Misc
[bacula/bacula] / regress / tests / small-file-size-tape
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory 
4 #   to a tape where the maximum tape file size is set to 1M
5 #
6 cwd=`pwd`
7 bin/bacula stop  2>&1 >/dev/null
8 scripts/copy-tape-confs
9 scripts/cleanup-tape
10 echo "${cwd}/build" >/tmp/file-list
11 bin/drop_sqlite_tables
12 bin/make_sqlite_tables
13 out="tmp/sed_tmp"
14 echo "s%# Maximum File Size%  Maximum File Size%g" >${out}
15 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
16 sed -f ${out} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
17
18 echo " "
19 echo " "
20 echo " === Starting Small File Size test ==="
21 echo " === Starting Small File Size test ===" >>working/log
22 echo " "
23
24 bin/bacula start 2>&1 >/dev/null
25 bin/console -c bin/console.conf <<END_OF_DATA
26 @output /dev/null
27 messages
28 @output tmp/log1.out
29 label storage=DDS-4 volume=TestVolume001 slot=0
30 run job=NightlySave yes
31 wait
32 messages
33 @# 
34 @# now do a restore
35 @#
36 @output tmp/log2.out
37 restore where=${cwd}/tmp/bacula-restores current all
38 yes
39 wait
40 messages
41 @output
42 quit
43 END_OF_DATA
44 bin/bacula stop 2>&1 >/dev/null
45 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
46 bstat=$?
47 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
48 rstat=$?
49 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
50 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
51    echo " "
52    echo " "
53    echo "  !!!!! Small File Size test Bacula source failed!!! !!!!! "
54    echo "  !!!!! Small File Size test failed!!! !!!!! " >>test.out
55    echo " "
56 else
57    echo "  ===== Small File Size test Bacula source OK ===== "
58    echo "  ===== Small File Size test OK ===== " >>test.out
59 #  scripts/cleanup
60 fi