]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/sparse-encrypt-test
Update
[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 1
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 list volumes
35 @# 
36 @# now do a restore
37 @#
38 @$out tmp/log2.out
39 @# setdebug level=0 fd
40 restore where=${cwd}/tmp/bacula-restores storage=File
41 5
42 mark *
43 done
44 yes
45 wait
46 messages
47 @$out
48 quit
49 END_OF_DATA
50
51 run_bacula
52 sleep 2
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