X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fsparse-encrypt-test;h=865b739b49da841a6ab528cf4605870b4641a377;hb=25daee7d2a896f1da1f4ac8ffd8b1b57454d1943;hp=fa6484d9687cd88ffbf556aac08c845749cebec6;hpb=57d79f51d2e8394ccff546db5de65bbfde7646f8;p=bacula%2Fbacula diff --git a/regress/tests/sparse-encrypt-test b/regress/tests/sparse-encrypt-test index fa6484d968..865b739b49 100755 --- a/regress/tests/sparse-encrypt-test +++ b/regress/tests/sparse-encrypt-test @@ -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 0 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,21 +18,23 @@ if [ $? != 0 ]; then fi cd ${cwd} +change_jobname SparseTest $JobName start_test -cat <tmp/bconcmds +cat <${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 wait messages +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 @@ -52,13 +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 =========" - 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