]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Update accurate test to check the number of files that are
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 24 Sep 2008 19:05:56 +0000 (19:05 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 24 Sep 2008 19:05:56 +0000 (19:05 +0000)
     Written during backup.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7635 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/functions
regress/tests/accurate-test

index de08eb340f2fba603359643332ca5dfa07ca5e7e..53b90e60f1fed363c203a3ef4fd9f7e2ef0b7c97 100644 (file)
@@ -98,6 +98,18 @@ print_debug()
    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
@@ -187,13 +199,13 @@ change_jobname()
 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
index cf43ffa13054727c0ebbc83a74327a77ecb754b9..1de8294ad1c7c5afd6b90eb1adfcb7c4cdd1bb3b 100755 (executable)
@@ -7,6 +7,7 @@
 # Run a accurate backup of the Bacula build directory
 #   then restore it.
 #
+
 TestName="accurate-test"
 JobName=backup
 . scripts/functions
@@ -90,6 +91,7 @@ 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
 
@@ -104,6 +106,7 @@ 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
 
@@ -117,6 +120,7 @@ check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -130,6 +134,7 @@ check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -143,6 +148,7 @@ check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 2
 
 rm -rf ${cwd}/tmp/bacula-restores
 
@@ -240,6 +246,7 @@ touch ${cwd}/build/accurate/bbbbbb
 
 run_bconsole
 check_for_zombie_jobs storage=File
+check_files_written ${cwd}/tmp/log1.out 3
 
 check_two_logs
 check_restore_diff
@@ -359,6 +366,7 @@ check_for_zombie_jobs storage=File
 
 check_two_logs
 check_restore_diff
+check_files_written ${cwd}/tmp/log1.out 1
 
 rm -rf ${cwd}/tmp/bacula-restores