]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Update copy tests
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 20 Oct 2008 16:50:48 +0000 (16:50 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 20 Oct 2008 16:50:48 +0000 (16:50 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7845 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/functions
regress/tests/copy-volume-test

index f62807d1dbd0fbb6ae8c375cebca43a2b284e810..46015f08474c8873d4eb7075b135ac7804adf804 100644 (file)
@@ -115,9 +115,9 @@ check_files_written()
 get_mig_info()
 {
     # index of the job in the log (start from 0)
-    IDX=$1
+    JOBID=$1
     LOG=$2
-    RET=`awk -v idx=$IDX -F: '/Prev Backup JobId/ { pbid[j++]=$2 } /New Backup JobId/  { nbid[i++]=$2 } END { print pbid[idx] " " nbid[idx] }' $LOG`
+    RET=`awk -v jobid=$JOBID -F: '/Prev Backup JobId/ { cjid=$2 } /New Backup JobId/  { if (cjid == jobid) { print $2 } }' $LOG`
 }
 
 get_duration()
index a2f596a4d1d0c04bd9c034188dd5cc8dc3444e44..d11bb18af98b04bf965d0b3ef8968d776ca90765 100755 (executable)
@@ -166,31 +166,27 @@ check_restore_diff
 
 stop_bacula
 
-get_mig_info 0 ${cwd}/tmp/log11.out
-set $RET
+get_mig_info 1 ${cwd}/tmp/log11.out
 
-if [ -z "$2" -o "$2" = 0 ]; then
+if [ -z "$RET" -o "$RET" -eq 0 ]; then
     bstat=2
     print_debug "The first job must have been copied"
 fi
 
-get_mig_info 1 ${cwd}/tmp/log11.out
-set $RET
+get_mig_info 2 ${cwd}/tmp/log11.out
 
-if [ -z "$2" -o "$2" != 0 ]; then
+if [ -z "$RET" -o "$RET" -ne 0 ]; then
     bstat=2
     print_debug "The second job have no files, it can't have been copied"
 fi
 
-get_mig_info 0 ${cwd}/tmp/log4.out
-set $RET
+JOBID=`awk -F= '/Job queued. JobId/ {if(!f){print $2; f=1;}}' ${cwd}/tmp/log4.out`
+get_mig_info $JOBID ${cwd}/tmp/log4.out
 
-if [ -z "$2" -o "$2" = 0 ]; then
+if [ -z "$RET" -o "$RET" -eq 0 ]; then
     bstat=2
     print_debug "The new incremental job must have been copied"
 fi
 
-
-
 check_two_logs
 end_test