]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Fix prune-migration-test with new check_prune_list()
authorEric Bollengier <eric@baculasystems.com>
Tue, 27 Nov 2018 10:16:51 +0000 (11:16 +0100)
committerKern Sibbald <kern@sibbald.com>
Mon, 8 Apr 2019 16:18:08 +0000 (18:18 +0200)
The job count was not done correctly for this test. We now detect the
job that we should not find in the pruning list.

regress/tests/prune-migration-test

index 98102cb24c1f52784b52eb63aa511b1386b9fa8d..8e6b15c8120c1f67fa28eda9adb05f86caf1f107 100755 (executable)
@@ -72,13 +72,17 @@ messages
 @$out $cwd/tmp/log10.out
 setdebug level=1 director
 sql
-SELECT JobId, JobTDate, StartTime, EndTime, Type FROM Job;
+SELECT JobId, Level, JobTDate, StartTime, EndTime, Type FROM Job ORDER BY JobId;
 
 list jobs
 prune jobs yes
 list jobs
 sql
-SELECT JobId, JobTDate, StartTime, EndTime, Type FROM Job;
+SELECT JobId, Level, JobTDate, StartTime, EndTime, Type FROM Job ORDER BY JobId;
+
+@$out $cwd/tmp/log11.out
+sql
+SELECT JobId FROM Job LIMIT 1;
 
 @################################################################ 
 @# now do a restore
@@ -111,9 +115,18 @@ check_restore_diff
 
 # M M g g F F I0 -> F
 # Note, for some strange reason, we end either with JobId=5 or
-#  with JobId=8.  Why it changes, I do not know, so we permit
-#  both of them below (absence of 5 and 8 in the list).
-$bperl -e "check_prune_list('$tmp/log10.out',1,2,3,4,7,9)"
+#  with JobId=8.  Why it changes, I do not know...
+# So, we get it from the job list to exclude it and build the check_prune_list
+id=`awk '/ [0-9] / { print $2 }' $tmp/log11.out`
+
+jobid=1
+for i in `seq 2 9`
+do
+    if [ $i != $id ]; then
+        jobid="$jobid,$i"
+    fi
+done
+$bperl -e "check_prune_list('$tmp/log10.out',$jobid)"
 estat=$(($estat + $?))
 
 end_test