From: Kern Sibbald Date: Mon, 19 Feb 2007 17:51:35 +0000 (+0000) Subject: Implement socket restore test X-Git-Tag: Release-7.0.0~6866 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e457430f7de9a394cbedcbc4b68ec66c0e6fcea0;p=bacula%2Fbacula Implement socket restore test git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4211 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/all-non-root-tests b/regress/all-non-root-tests index a93536d57e..6c205f5aba 100755 --- a/regress/all-non-root-tests +++ b/regress/all-non-root-tests @@ -14,6 +14,10 @@ tests/compressed-test tests/compress-encrypt-test tests/concurrent-jobs-test tests/data-encrypt-test +tests/encrypt-bug-test +# The following two can uses *lots* of disk space +# so they are normally turned off, but if you have +# at least two GB free, you can run them #tests/sparse-encrypt-test #tests/gigaslam-sparse-test tests/differential-test diff --git a/regress/encrypt-bug.jpg b/regress/encrypt-bug.jpg new file mode 100644 index 0000000000..18825f97ba Binary files /dev/null and b/regress/encrypt-bug.jpg differ diff --git a/regress/tests/encrypt-bug-test b/regress/tests/encrypt-bug-test index 9c9f468b27..f39f036a79 100755 --- a/regress/tests/encrypt-bug-test +++ b/regress/tests/encrypt-bug-test @@ -6,11 +6,12 @@ TestName="encrypt-bug-test" JobName=Crypto-bug . scripts/functions -set_debug 1 +set_debug 0 scripts/cleanup scripts/copy-crypto-confs -echo "${cwd}/untitled15.jpg" >/tmp/file-list +file="${cwd}/encrypt-bug.jpg" +echo "${file}" >/tmp/file-list change_jobname NightlySave $JobName start_test @@ -20,7 +21,7 @@ cat <tmp/bconcmds messages @$out tmp/log1.out label storage=File volume=TestVolume001 -@#setdebug level=10 fd +setdebug level=100 fd run job=$JobName yes wait messages @@ -28,7 +29,7 @@ messages @# now do a restore @# @$out tmp/log2.out -@#setdebug level=10 fd +setdebug level=100 fd restore where=${cwd}/tmp/bacula-restores storage=File 5 mark * @@ -50,5 +51,6 @@ du -s tmp/bacula-restores/ check_two_logs -check_restore_diff +diff ${file} ${cwd}/tmp/bacula-restores/${file} 2>&1 >/dev/null +dstat=$? end_test diff --git a/regress/tests/sparse-encrypt-test b/regress/tests/sparse-encrypt-test index 13dca21381..a3c9a6fce0 100755 --- a/regress/tests/sparse-encrypt-test +++ b/regress/tests/sparse-encrypt-test @@ -52,10 +52,15 @@ 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 diff --git a/regress/tests/weird-files-test b/regress/tests/weird-files-test index 96fed89322..fea5007f40 100755 --- a/regress/tests/weird-files-test +++ b/regress/tests/weird-files-test @@ -27,6 +27,11 @@ change_jobname NightlySave $JobName echo "${cwd}/weird-files" >/tmp/file-list echo "${cwd}/weird-files" >>/tmp/file-list +# Create a Unix domain socket (sock-file) +cd weird-files +perl socket.pl +cd .. + start_test cat <tmp/bconcmds @@ -57,6 +62,10 @@ END_OF_DATA run_bacula check_for_zombie_jobs storage=File stop_bacula +# Note, the Unix domain socket (sock-file) is not restored +# by Bacula so we delete it for the diffs +rm -f weird-files/sock-file +touch weird-files tmp/bacula-restores${cwd}/weird-files ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/original cd tmp/bacula-restores${cwd} @@ -64,6 +73,8 @@ ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/restored cd ${cwd} check_two_logs -diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null +#diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null +diff ${cwd}/tmp/original ${cwd}/tmp/restored + dstat=$? end_test diff --git a/regress/tests/weird-files2-test b/regress/tests/weird-files2-test index ec328155dd..221abbf075 100755 --- a/regress/tests/weird-files2-test +++ b/regress/tests/weird-files2-test @@ -19,11 +19,14 @@ scripts/copy-test-confs rm -rf weird-files2 cp -Rp weird-files weird-files2 echo "${cwd}/weird-files2" >/tmp/file-list +cd weird-files2 +perl socket.pl +cd .. change_jobname NightlySave $JobName start_test -bin/testls weird-files2 >${cwd}/tmp/original +bin/testls weird-files2 | grep -v sock-file >${cwd}/tmp/original cat <tmp/bconcmds @$out /dev/null @@ -74,7 +77,8 @@ stop_bacula bin/testls weird-files2 >${cwd}/tmp/restored check_two_logs -diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null +#diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null +diff ${cwd}/tmp/original ${cwd}/tmp/restored dstat=$? end_test diff --git a/regress/weird-files.tar.gz b/regress/weird-files.tar.gz index fbe6604978..b4b77f422c 100644 Binary files a/regress/weird-files.tar.gz and b/regress/weird-files.tar.gz differ