]> git.sur5r.net Git - bacula/bacula/commitdiff
add big-vol-test
authorKern Sibbald <kern@sibbald.com>
Sat, 21 Jul 2007 16:54:34 +0000 (16:54 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 21 Jul 2007 16:54:34 +0000 (16:54 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5209 91ce42f0-d328-0410-95d8-f526ca767f89

regress/tests/big-vol-test [new file with mode: 0755]

diff --git a/regress/tests/big-vol-test b/regress/tests/big-vol-test
new file mode 100755 (executable)
index 0000000..36b0466
--- /dev/null
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# Create a big Volume > 5 GB and backup to it to test disk
+#   seeking on big volumes.  We cheat and artifically grow 
+#   the volume.
+#
+TestName="big-vol-test"
+JobName=bigvol
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-test-confs
+echo "${cwd}/build" >/tmp/file-list
+
+change_jobname CompressedTest $JobName
+start_test
+
+cat <<END_OF_DATA >tmp/bconcmds
+@output /dev/null
+messages
+@$out tmp/log1.out
+@#setdebug level=100 storage=File
+label storage=File volume=TestVolume001
+run job=$JobName yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+
+#
+# Now increase the size of the Volume using gigaslam
+#
+cd ${cwd}/tmp
+# make 1 GB file
+${cwd}/build/src/tools/gigaslam
+if [ $? != 0 ]; then
+   echo "Execute of ${cwd}/build/src/tools/gigaslam failed."
+   rm -f gigaslam.gif
+   exit 1
+fi
+cat gigaslam.gif >>TestVolume001
+cat gigaslam.gif >>TestVolume001
+cat gigaslam.gif >>TestVolume001
+cat gigaslam.gif >>TestVolume001
+cat gigaslam.gif >>TestVolume001
+size=`ls -l TestVolume001 | cut -f 5 -d ' '`
+ls -l TestVolume001
+cd ${cwd}
+cat <<END_OF_DATA >tmp/bconcmds
+@output /dev/null
+messages
+@$out tmp/log1.out
+sql
+UPDATE Media SET Volbytes=${size} WHERE VolumeName='TestVolume001';
+
+llist volume=TestVolume001
+@# Now do another full save with big Volume
+run level=Full job=$JobName yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+sql
+SELECT * FROM JobMedia;
+
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores storage=File select all done
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+run_bconsole
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test
+# Get rid of big files
+rm -f ${cwd}/tmp/gigaslam.gif
+rm -f ${cwd}/tmp/TestVolume001