fi
}
+check_files_written()
+{
+ LOG=$1
+ NB=$2
+ FILES=`awk '/FD Files Written:/ { last=$4 } END { print last }' $LOG`
+
+ if [ "$NB" != "$FILES" ]; then
+ print_debug "Expect $NB files, get $FILES"
+ bstat=2
+ fi
+}
+
run_bacula()
{
debug_wait
check_two_logs()
{
grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
- bstat=$?
+ bstat=${bstat-$?}
grep "^ Termination: .*Backup Error" tmp/log1.out 2>&1 >/dev/null
if test $? -eq 0; then
bstat=2
fi
grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
- rstat=$?
+ rstat=${rstat-$?}
grep "^ Termination: .*Restore Error" tmp/log2.out 2>&1 >/dev/null
if test $? -eq 0; then
rstat=2
# Run a accurate backup of the Bacula build directory
# then restore it.
#
+
TestName="accurate-test"
JobName=backup
. scripts/functions
check_two_logs
check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 4
rm -rf ${cwd}/tmp/bacula-restores
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
run_bconsole
check_for_zombie_jobs storage=File
+check_files_written ${cwd}/tmp/log1.out 3
check_two_logs
check_restore_diff
check_two_logs
check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 1
rm -rf ${cwd}/tmp/bacula-restores