]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/sparse-encrypt-test
fa6484d9687cd88ffbf556aac08c845749cebec6
[bacula/bacula] / regress / tests / sparse-encrypt-test
1 #!/bin/sh
2 #
3 # Run a simple backup (with encryption) of the Bacula build directory
4 #   then verify the signatures.
5 #
6 TestName="sparse-encrypt-test"
7 JobName=Crypto
8 . scripts/functions
9 set_debug 0
10
11 scripts/cleanup
12 scripts/copy-crypto-confs
13 echo "${cwd}/build" >/tmp/file-list
14 cd ${cwd}/build/src/tools
15 ./gigaslam
16 if [ $? != 0 ]; then
17    echo "Execute of ${cwd}/build/src/tools/gigaslam failed."
18    rm -f ${cwd}/build/src/tools/gigaslam.gif
19    exit 1
20 fi
21 cd ${cwd}
22
23 start_test
24
25 cat <<END_OF_DATA >tmp/bconcmds
26 @$out /dev/null
27 messages
28 @$out tmp/log1.out
29 label storage=File volume=TestVolume001
30 setdebug level=10 fd
31 run job=$JobName yes
32 wait
33 messages
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