]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/sparse-encrypt-test
regress: tweak the message in the update_win32()
[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 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 -f ${cwd}/build/gigaslam.gif