# Run a accurate backup of the Bacula build directory
# then restore it.
#
+
TestName="accurate-test"
JobName=backup
. scripts/functions
# add extra files
mkdir ${cwd}/build/accurate
+mkdir ${cwd}/build/accurate/dirtest
+echo "test test" > ${cwd}/build/accurate/dirtest/hello
echo "test test" > ${cwd}/build/accurate/xxx
echo "test test" > ${cwd}/build/accurate/yyy
echo "test test" > ${cwd}/build/accurate/zzz
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
+setdebug level=10 storage=File
restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
yes
wait
# Now do a second backup after making few changes
################################################################
rm ${cwd}/build/accurate/xxx # delete a file
+rm ${cwd}/build/accurate/dirtest/hello
run_bconsole
check_for_zombie_jobs storage=File
check_two_logs
check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 4
rm -rf ${cwd}/tmp/bacula-restores
# Now do a third backup after making few changes
################################################################
rm ${cwd}/build/accurate/yyyyyy # delete a file
+rmdir ${cwd}/build/accurate/dirtest
run_bconsole
check_for_zombie_jobs storage=File
check_two_logs
check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 3
rm -rf ${cwd}/tmp/bacula-restores
check_two_logs
check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
rm -rf ${cwd}/tmp/bacula-restores
check_two_logs
check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
rm -rf ${cwd}/tmp/bacula-restores
check_two_logs
check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
rm -rf ${cwd}/tmp/bacula-restores
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
+setdebug level=10 storage=File
restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
yes
wait
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
+setdebug level=10 storage=File
restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
yes
wait
run_bconsole
check_for_zombie_jobs storage=File
+check_files_written ${cwd}/tmp/log1.out 3
check_two_logs
check_restore_diff
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
+setdebug level=10 storage=File
restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
yes
wait
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
+setdebug level=10 storage=File
restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done
yes
wait
@# now do a restore
@#
@$out ${cwd}/tmp/log2.out
+setdebug level=10 storage=File
restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done
yes
wait
check_two_logs
check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 1
rm -rf ${cwd}/tmp/bacula-restores
grep yyy ${cwd}/tmp/log3.out > /dev/null
if [ $? != 0 ] ; then
- print_debug "Can't find xxx file into 'list files' output (${cwd}/tmp/log3.out)"
+ print_debug "Can't find yyy file into 'list files' output (${cwd}/tmp/log3.out)"
dstat=2
fi