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