]> git.sur5r.net Git - bacula/bacula/commitdiff
tweak debug
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 23 Apr 2010 09:12:16 +0000 (11:12 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 23 Apr 2010 09:12:28 +0000 (11:12 +0200)
bacula/src/lib/jcr.c
regress/tests/duplicate-job-test

index 8d772384381f0e63bcfb72c7a530693a58a64777..266f6e2b9a35025f63c397d6c947d05c7c097a55 100644 (file)
@@ -627,7 +627,7 @@ void JCR::my_thread_send_signal(int sig)
       pthread_kill(this->my_thread_id, sig);
 
    } else if (!this->my_thread_running) {
-      Dmsg1(0, "Warning, can't send kill to jid=%d\n", this->JobId);
+      Dmsg1(10, "Warning, can't send kill to jid=%d\n", this->JobId);
    }
    this->unlock();
 }
index 45494855d9cbbb9721ae4e5cba0c2b345c9eec20..bc95be13696318123362449da5cb17191696118b 100755 (executable)
@@ -8,13 +8,16 @@ 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_concurent_jobs("$conf/bacula-dir.conf",100)'
+perl -Mscripts::functions -e 'set_maximum_concurent_jobs("$conf/bacula-sd.conf",100)'
+perl -Mscripts::functions -e 'set_maximum_concurent_jobs("$conf/bacula-fd.conf",100)'
 
 # extract a Job and add a runscript on it
 perl -Mscripts::functions \
     -e "extract_resource('$conf/bacula-dir.conf', 'Job', 'CompressedTest')" \
     | sed 's%Standard%Standard; ClientRunBeforeJob="sleep 6"%' > $tmp/1
 
-
 outf="$tmp/sed_tmp"
 echo 's%CompressedTest%AllowDuplicateYes%' > $outf
 echo 's%Backup%Backup; AllowDuplicateJobs = yes%' >> $outf
@@ -36,7 +39,14 @@ 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))"`
+for i in `seq 1 40`; do
+    echo "s%CompressedTest%CancelLowerLevelDuplicatesYes-$i%" > $outf
+    echo 's%Backup%Backup; AllowDuplicateJobs = no; CancelLowerLevelDuplicates=yes%' >> $outf
+    echo 's%sleep 6%sleep 20%' >> $outf
+    sed -f $outf $tmp/1 >> $conf/bacula-dir.conf
+done
+
+when=`perl -Mscripts::functions -e "get_time(300)"`
 
 start_test
       
@@ -145,6 +155,39 @@ run  level=Full job=CancelRunningDuplicatesNo yes
 run  level=Full job=CancelRunningDuplicatesNo yes
 wait
 messages
+@$out $tmp/log61.out
+@##########################
+@# run a bunch of job
+@##########################
+END_OF_DATA
+
+for i in `seq 1 40`; do
+  cat <<EOF  >>${cwd}/tmp/bconcmds 
+run comment="Should work" level=Full job=CancelLowerLevelDuplicatesYes-$i yes
+EOF
+done
+
+echo "wait" >> ${cwd}/tmp/bconcmds
+echo "messages" >> ${cwd}/tmp/bconcmds
+
+for i in `seq 1 40`; do
+  cat <<EOF >>${cwd}/tmp/bconcmds
+run comment="Should fail" level=Incremental job=CancelLowerLevelDuplicatesYes-$i yes
+EOF
+done
+
+echo "@sleep 5" >> ${cwd}/tmp/bconcmds
+
+for i in `seq 1 40`; do
+  cat <<EOF >>${cwd}/tmp/bconcmds
+run comment="Should work" level=Full job=CancelLowerLevelDuplicatesYes-$i yes
+EOF
+done
+
+echo "wait" >> ${cwd}/tmp/bconcmds
+echo "messages" >> ${cwd}/tmp/bconcmds
+
+cat <<END_OF_DATA >>${cwd}/tmp/bconcmds
 @$out $tmp/log7.out
 sql
 SELECT JobId, Job FROM Job WHERE JobId IN (1,2,3,6,8,9,11,13,16,18,19) AND JobStatus != 'T';
@@ -167,18 +210,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 80 ]; then
+    print_debug "ERROR: no enough results in $tmp/log9.out"
+    print_debug `cat $tmp/log9.out`
+    estat=1
+fi
+
 end_test