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