]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/gigaslam-sparse-test
update
[bacula/bacula] / regress / tests / gigaslam-sparse-test
index 00223111a288f0edc2da196106602b0178364d3a..f3b560af07c878d473ac1bdfb02a3467be3d6082 100755 (executable)
@@ -3,15 +3,13 @@
 # Run a simple backup of the Bacula build directory using the Sparse option
 #   then restore it.
 #
-TestName="sparse-test"
+TestName="gigaslam-sparse-test"
 JobName=SparseTest
 . scripts/functions
-set_debug 1
 
-cwd=`pwd`
 scripts/cleanup
 scripts/copy-test-confs
-echo "${cwd}/build" >/tmp/file-list
+echo "${cwd}/build" >${cwd}/tmp/file-list
 cd ${cwd}/build/src/tools
 ./gigaslam
 if [ $? != 0 ]; then
@@ -23,10 +21,10 @@ cd ${cwd}
 
 start_test
 
-cat >tmp/bconcmds <<END_OF_DATA
+cat >${cwd}/tmp/bconcmds <<END_OF_DATA
 @output /dev/null
 messages
-@$out tmp/log1.out
+@$out ${cwd}/tmp/log1.out
 label storage=File volume=TestVolume001
 run job=$JobName yes
 wait
@@ -35,7 +33,7 @@ list volumes
 @# 
 @# now do a restore
 @#
-@$out tmp/log2.out
+@$out ${cwd}/tmp/log2.out
 restore where=${cwd}/tmp/bacula-restores select storage=File
 unmark *
 mark *
@@ -49,10 +47,16 @@ END_OF_DATA
 
 run_bacula
 check_for_zombie_jobs storage=File 
-ls -l ${cwd}/tmp
 stop_bacula
 
+size=`du ${cwd}/tmp/bacula-restores/${cwd}/build/src/tools/gigaslam.gif | cut -f 1`
+if [ $size -gt 120 ]; then
+   echo "========== restored sparse file gigaslam.gif too big ========="
+   echo "      size is ${size}K it should be 120K"
+fi
+
 check_two_logs
 check_restore_diff
 end_test
 rm -f ${cwd}/build/src/tools/gigaslam.gif
+rm -f ${cwd}/build/gigaslam.gif