]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/sparse-encrypt-test
Update 2drive test
[bacula/bacula] / regress / tests / sparse-encrypt-test
index 5a20ae6b5c3cdcbb178b8111968fecb772f6165e..f1d6aaba20a122cb9b28658f2a8f83378f9ae1aa 100755 (executable)
@@ -1,12 +1,10 @@
 #!/bin/sh
 #
-# Run a simple backup (with encryption) of the Bacula build directory
-#   then verify the signatures.
+# Run a simple backup with encryption and a real sparse file.
 #
 TestName="sparse-encrypt-test"
 JobName=Crypto
 . scripts/functions
-set_debug 0
 
 scripts/cleanup
 scripts/copy-crypto-confs
@@ -20,6 +18,7 @@ if [ $? != 0 ]; then
 fi
 cd ${cwd}
 
+change_jobname SparseTest $JobName
 start_test
 
 cat <<END_OF_DATA >tmp/bconcmds
@@ -31,6 +30,7 @@ setdebug level=10 fd
 run job=$JobName yes
 wait
 messages
+list volumes
 @# 
 @# now do a restore
 @#
@@ -52,12 +52,19 @@ sleep 2
 check_for_zombie_jobs storage=File 
 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 ========="
+if [ ! -f ${cwd}/tmp/bacula-restores/${cwd}/build/src/tools/gigaslam.gif ]; then
+   echo "============= file gigaslam.gif was not restored ======="
+   size=0
+else
+   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                                                    
 fi
 
 check_two_logs
 check_restore_diff
 end_test
 rm -f ${cwd}/build/src/tools/gigaslam.gif
+rm -f ${cwd}/build/gigaslam.gif