]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/duplicate-job-test
regress: test restore object in plugin-test
[bacula/bacula] / regress / tests / duplicate-job-test
index 045b300e2f756fc95c9f5817270f89bf0986a082..0113e719ed9468313860265550efe0843736b2c9 100755 (executable)
@@ -8,6 +8,10 @@ scripts/cleanup
 scripts/copy-test-confs
 echo "${cwd}/build/technotes" >${cwd}/tmp/file-list
 
+# increase the maximum concurrent jobs for FD, SD and DIR
+perl -Mscripts::functions -e 'set_maximum_concurrent_jobs("$conf/bacula-dir.conf",100)'
+perl -Mscripts::functions -e 'set_maximum_concurrent_jobs("$conf/bacula-sd.conf",100)'
+perl -Mscripts::functions -e 'set_maximum_concurrent_jobs("$conf/bacula-fd.conf",100)'
 
 # extract a Job and add a runscript on it
 perl -Mscripts::functions \
@@ -36,7 +40,7 @@ echo 's%CompressedTest%CancelRunningDuplicatesNo%' > $outf
 echo 's%Backup%Backup; AllowDuplicateJobs = no;CancelLowerLevelDuplicates=no;CancelQueuedDuplicates=no; CancelRunningDuplicates=no%' >> $outf
 sed -f $outf $tmp/1 >> $conf/bacula-dir.conf
 
-when=`perl -MPOSIX -e "print strftime('%F %T', localtime(time+300))"`
+when=`perl -Mscripts::functions -e "get_time(300)"`
 
 start_test
       
@@ -46,6 +50,7 @@ messages
 @$out ${cwd}/tmp/log1.out
 messages
 label storage=File volume=TestVolume001
+@#setdebug level=100 storage=File
 @##############################################
 @# AllowDuplicates = Yes, both jobs should work
 @##############################################
@@ -148,18 +153,25 @@ stop_bacula
 touch $tmp/log2.out
 check_two_logs
 
-grep '^| [0-9]' $tmp/log7.out > /dev/null
+grep '^| *[0-9]' $tmp/log7.out > /dev/null
 if [ $? = 0 ]; then
-    print_debug "E: Found errors in $tmp/log7.out"
+    print_debug "ERROR: Found errors in $tmp/log7.out"
     print_debug `cat $tmp/log7.out`
     estat=1
 fi
 
-grep '^| [0-9]' $tmp/log8.out > /dev/null
+grep '^| *[0-9]' $tmp/log8.out > /dev/null
 if [ $? = 0 ]; then
-    print_debug "E: Found errors in $tmp/log8.out"
+    print_debug "ERROR: Found errors in $tmp/log8.out"
     print_debug `cat $tmp/log8.out`
     estat=1
 fi
 
+nb=`grep '^| *[0-9]' $tmp/log9.out | wc -l`
+if [ $nb -lt 10 ]; then
+    print_debug "ERROR: no enough results in $tmp/log9.out"
+    print_debug `cat $tmp/log9.out`
+    estat=1
+fi
+
 end_test