]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/big-vol-test
36b0466591614dc7b5c650b4b56006a28a8e6250
[bacula/bacula] / regress / tests / big-vol-test
1 #!/bin/sh
2 #
3 # Create a big Volume > 5 GB and backup to it to test disk
4 #   seeking on big volumes.  We cheat and artifically grow 
5 #   the volume.
6 #
7 TestName="big-vol-test"
8 JobName=bigvol
9 . scripts/functions
10
11 scripts/cleanup
12 scripts/copy-test-confs
13 echo "${cwd}/build" >/tmp/file-list
14
15 change_jobname CompressedTest $JobName
16 start_test
17
18 cat <<END_OF_DATA >tmp/bconcmds
19 @output /dev/null
20 messages
21 @$out tmp/log1.out
22 @#setdebug level=100 storage=File
23 label storage=File volume=TestVolume001
24 run job=$JobName yes
25 wait
26 messages
27 quit
28 END_OF_DATA
29
30 run_bacula
31 check_for_zombie_jobs storage=File
32
33 #
34 # Now increase the size of the Volume using gigaslam
35 #
36 cd ${cwd}/tmp
37 # make 1 GB file
38 ${cwd}/build/src/tools/gigaslam
39 if [ $? != 0 ]; then
40    echo "Execute of ${cwd}/build/src/tools/gigaslam failed."
41    rm -f gigaslam.gif
42    exit 1
43 fi
44 cat gigaslam.gif >>TestVolume001
45 cat gigaslam.gif >>TestVolume001
46 cat gigaslam.gif >>TestVolume001
47 cat gigaslam.gif >>TestVolume001
48 cat gigaslam.gif >>TestVolume001
49 size=`ls -l TestVolume001 | cut -f 5 -d ' '`
50 ls -l TestVolume001
51 cd ${cwd}
52 cat <<END_OF_DATA >tmp/bconcmds
53 @output /dev/null
54 messages
55 @$out tmp/log1.out
56 sql
57 UPDATE Media SET Volbytes=${size} WHERE VolumeName='TestVolume001';
58
59 llist volume=TestVolume001
60 @# Now do another full save with big Volume
61 run level=Full job=$JobName yes
62 wait
63 messages
64 @# 
65 @# now do a restore
66 @#
67 sql
68 SELECT * FROM JobMedia;
69
70 @output tmp/log2.out
71 restore where=${cwd}/tmp/bacula-restores storage=File select all done
72 yes
73 wait
74 messages
75 @$out
76 quit
77 END_OF_DATA
78
79 run_bconsole
80 check_for_zombie_jobs storage=File
81 stop_bacula
82
83 check_two_logs
84 check_restore_diff
85 end_test
86 # Get rid of big files
87 rm -f ${cwd}/tmp/gigaslam.gif
88 rm -f ${cwd}/tmp/TestVolume001