]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/sparse-encrypt-test
regress: add function to create many dirs
[bacula/bacula] / regress / tests / sparse-encrypt-test
index 3893dae71ab8a2405e8077d1e55668b58db89db9..2dc79f41878c83fd9aa0d7d586369b2bdc550592 100755 (executable)
@@ -1,16 +1,14 @@
 #!/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 1
 
 scripts/cleanup
 scripts/copy-crypto-confs
-echo "${cwd}/build" >/tmp/file-list
+echo "${cwd}/build" >${cwd}/tmp/file-list
 cd ${cwd}/build/src/tools
 ./gigaslam
 if [ $? != 0 ]; then
@@ -20,12 +18,13 @@ if [ $? != 0 ]; then
 fi
 cd ${cwd}
 
+change_jobname SparseTest $JobName
 start_test
 
-cat <<END_OF_DATA >tmp/bconcmds
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @$out /dev/null
 messages
-@$out tmp/log1.out
+@$out ${cwd}/tmp/log1.out
 label storage=File volume=TestVolume001
 setdebug level=10 fd
 run job=$JobName yes
@@ -35,7 +34,7 @@ list volumes
 @# 
 @# now do a restore
 @#
-@$out tmp/log2.out
+@$out ${cwd}/tmp/log2.out
 @# setdebug level=0 fd
 restore where=${cwd}/tmp/bacula-restores storage=File
 5
@@ -44,7 +43,6 @@ done
 yes
 wait
 messages
-@$out
 quit
 END_OF_DATA
 
@@ -53,13 +51,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 ========="
-   echo "      size is ${size}K it should be 120K"
+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