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
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
messages
@$out tmp/log1.out
label storage=File volume=TestVolume001
-@#setdebug level=10 fd
+setdebug level=100 fd
run job=$JobName yes
wait
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 *
check_two_logs
-check_restore_diff
+diff ${file} ${cwd}/tmp/bacula-restores/${file} 2>&1 >/dev/null
+dstat=$?
end_test
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
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
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}
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
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
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