]> git.sur5r.net Git - bacula/bacula/commitdiff
Implement socket restore test
authorKern Sibbald <kern@sibbald.com>
Mon, 19 Feb 2007 17:51:35 +0000 (17:51 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 19 Feb 2007 17:51:35 +0000 (17:51 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4211 91ce42f0-d328-0410-95d8-f526ca767f89

regress/all-non-root-tests
regress/encrypt-bug.jpg [new file with mode: 0644]
regress/tests/encrypt-bug-test
regress/tests/sparse-encrypt-test
regress/tests/weird-files-test
regress/tests/weird-files2-test
regress/weird-files.tar.gz

index a93536d57e2880a104a0e2f076fb076abdf3a38d..6c205f5aba1f381f0508b724d356662b050a8c78 100755 (executable)
@@ -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 (file)
index 0000000..18825f9
Binary files /dev/null and b/regress/encrypt-bug.jpg differ
index 9c9f468b270a3bd9c37fb551a16891cd92a5cfc3..f39f036a79224242717490c62cce9c6f45eeee94 100755 (executable)
@@ -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 <<END_OF_DATA >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
index 13dca21381d50219440eec6efb21b08407c86ff1..a3c9a6fce02f347a16c35e6d7457631c689d4799 100755 (executable)
@@ -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
index 96fed8932223a49901bfacee8520b37c61a98fed..fea5007f401ef1a0bd7689150e1cd76fc69ec5ee 100755 (executable)
@@ -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 <<END_OF_DATA >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
index ec328155dd92000853b5c5361045f0a477c31b03..221abbf0758ceab647267fa3d19d079ad0d715eb 100755 (executable)
@@ -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 <<END_OF_DATA >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
index fbe6604978cde842d3e370159bdbfeb99593a832..b4b77f422c98d4fa1a05ed017997077c94376b16 100644 (file)
Binary files a/regress/weird-files.tar.gz and b/regress/weird-files.tar.gz differ