]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/sparse-encrypt-test
Copy trunk regress into Branch
[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" >${cwd}/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 change_jobname SparseTest $JobName
22 start_test
23
24 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
25 @$out /dev/null
26 messages
27 @$out ${cwd}/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 ${cwd}/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 if [ ! -f ${cwd}/tmp/bacula-restores/${cwd}/build/src/tools/gigaslam.gif ]; then
56    echo "============= file gigaslam.gif was not restored ======="
57    size=0
58 else
59    size=`du ${cwd}/tmp/bacula-restores/${cwd}/build/src/tools/gigaslam.gif | cut -f 1`
60   if [ $size -gt 120 ]; then
61       echo "========== restored sparse file: gigaslam.gif too big ========="
62       echo "      size is ${size}K it should be 120K"
63    fi                                                    
64 fi
65
66 check_two_logs
67 check_restore_diff
68 end_test
69 rm -f ${cwd}/build/src/tools/gigaslam.gif
70 rm -f ${cwd}/build/gigaslam.gif