]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/gigaslam-sparse-test
Updates
[bacula/bacula] / regress / tests / gigaslam-sparse-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the Sparse option
4 #   then restore it.
5 #
6 TestName="gigaslam-sparse-test"
7 JobName=SparseTest
8 . scripts/functions
9 set_debug 0
10
11 cwd=`pwd`
12 scripts/cleanup
13 scripts/copy-test-confs
14 echo "${cwd}/build" >/tmp/file-list
15 cd ${cwd}/build/src/tools
16 ./gigaslam
17 if [ $? != 0 ]; then
18    echo "Execute of ${cwd}/build/src/tools/gigaslam failed."
19    rm -f ${cwd}/build/src/tools/gigaslam.gif
20    exit 1
21 fi
22 cd ${cwd}
23
24 start_test
25
26 cat >tmp/bconcmds <<END_OF_DATA
27 @output /dev/null
28 messages
29 @$out tmp/log1.out
30 label storage=File volume=TestVolume001
31 run job=$JobName yes
32 wait
33 messages
34 list volumes
35 @# 
36 @# now do a restore
37 @#
38 @$out tmp/log2.out
39 restore where=${cwd}/tmp/bacula-restores select storage=File
40 unmark *
41 mark *
42 done
43 yes
44 wait
45 messages
46 @output
47 quit
48 END_OF_DATA
49
50 run_bacula
51 check_for_zombie_jobs storage=File 
52 stop_bacula
53
54 size=`du ${cwd}/tmp/bacula-restores/${cwd}/build/src/tools/gigaslam.gif | cut -f 1`
55 if [ $size -gt 120 ]; then
56    echo "========== restored sparse file gigaslam.gif too big ========="
57    echo "      size is ${size}K it should be 120K"
58 fi
59
60 check_two_logs
61 check_restore_diff
62 end_test
63 rm -f ${cwd}/build/src/tools/gigaslam.gif
64 rm -f ${cwd}/build/gigaslam.gif