]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/functions
Check for file count mismatch
[bacula/bacula] / regress / scripts / functions
index fcf773fb70db51b752d92649d2851445171ac51c..28c85f3a77cc3cc612b7cffe38b1463095f1af81 100644 (file)
@@ -11,6 +11,20 @@ start_test()
    echo " "
 }
 
+require_root()
+{
+MUID=`/usr/bin/id | awk -F= '{print $2}' | awk -F\( '{print $1}'`
+if [ $MUID != 0 ] ; then
+   echo " "
+   echo "You must be root to run this test."
+   echo "  ===== !!!! $TestName not run at `date +%R:%S` ==="
+   echo "  ===== !!!! $TestName not run at `date +%R:%S` !!!! ===== " >>test.out
+   echo " "
+   exit 1
+fi
+}
+
+
 set_debug()
 {
    debug=$1
@@ -70,7 +84,7 @@ stop_bacula()
 
 check_for_zombie_jobs()
 {
-   scripts/check_for_zombie_jobs $1
+   scripts/check_for_zombie_jobs $*
 }
 
 change_jobname()
@@ -95,6 +109,10 @@ check_two_logs()
    bstat=$?
    grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
    rstat=$?
+   grep "^  Termination: *Restore OK -- warning file count mismatch" tmp/log2.out 2>&1 >/dev/null
+   if test $? -eq 0; then
+      rstat = 2
+   fi
 }
 
 check_restore_diff()
@@ -119,9 +137,11 @@ end_test()
       if [ $bstat != 0 -o $rstat != 0 ] ; then
          echo "  !!!!! Bad Job termination status     !!!!! "
          echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
+         echo "        bstat=$bstat rstat=$rstat dstat=$dstat"
       else
          echo "  !!!!! Restored files differ          !!!!! "
          echo "  !!!!! Restored files differ          !!!!! " >>test.out
+         echo "        bstat=$bstat rstat=$rstat dstat=$dstat"
       fi
       echo " "
    else
@@ -161,5 +181,5 @@ else
    set_debug 0
 fi
 
-# Source the second drive variables
-. ${cwd}/config.out
+# Source the configuration variables
+. ${cwd}/config