3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run four concurrent jobs and then cancel 2 of them
11 TestName="cancel-multiple-jobs-test"
12 JobName=concurrent-jobs
17 echo "${cwd}/tmp/largefile" >${cwd}/tmp/file-list
18 if test -c /dev/urandom ; then
19 # Create 56MB file with random data
20 # echo "Creating a 56MB file with random data ..."
21 dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000 2>&1 1>/dev/null
23 # echo "Creating a 56MB file with bacula-dir data ..."
24 dd if=$bin/bacula-dir of=${cwd}/tmp/1 bs=1024 count=1000 2>&1 1>/dev/null
25 cat ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 >${cwd}/tmp/2
27 cat ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 >>${cwd}/tmp/3
29 cat ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 >${cwd}/tmp/largefile
33 #echo "largefile created"
35 # Add some jobs and fileset for this test
36 cat <<EOF >>${cwd}/bin/bacula-dir.conf
45 Maximum Concurrent Jobs = 10
48 Reschedule On Error = no
49 Reschedule Interval = 10
54 ClientRunBeforeJob="sleep 20"
64 change_jobname CompressedTest $JobName
67 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
70 @$out ${cwd}/tmp/log1.out
71 label storage=File volume=TestVolume001
72 run job=RUN4 level=Full yes
73 run job=RUN4 level=Full yes
74 run job=RUN4 level=Full yes
75 run job=RUN4 level=Full yes
84 @$out ${cwd}/tmp/log2.out
85 restore where=${cwd}/tmp/bacula-restores select storage=File
93 run job=RUN4 level=Full yes
94 @# it will cancel the jobid 6 even if jobid 1 is requested
102 check_for_zombie_jobs storage=File
106 diff ${cwd}/tmp/largefile ${cwd}/tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
109 grep "Backup Canceled" $tmp/log3.out > /dev/null
110 if [ $? -eq 0 ]; then
111 print_debug "ERROR: 'cancel jobid=1 yes' command should not cancel an other job"