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