3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Run a simple backup of the Bacula build directory and see
7 # if bacula is respecting the maximum concurrent job (MJC)
17 # Zap out any schedule in default conf file so that
18 # it doesn't start during our test
21 echo "s% Schedule =%# Schedule =%g" >${outf}
22 cp $scripts/bacula-dir.conf $tmp/1
23 sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf
25 change_jobname BackupClient1 $JobName
28 cat <<END_OF_DATA >$tmp/bconcmds
32 label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
34 setbandwidth limit="100 kb/s" client
35 run job=$JobName level=full yes
39 run job=$JobName level=full comment="Should be waiting for Maximum Concurrent Job" yes
42 @# The following reload command is causing a bug with the current code
45 run job=$JobName level=full comment="Should be waiting for Maximum Concurrent Job" yes
48 @# ##################################################################################
49 @# If everything is alright, we should find two jobs waiting for MaximumConcurrentJob
50 @# ##################################################################################
52 @# ##################################################################################
54 setbandwidth limit="10000000 kb/s" client
61 restore where=$tmp/bacula-restores select all done
69 check_for_zombie_jobs storage=File1
75 nb=$(grep "is waiting" $tmp/log3.out | wc -l)
76 if [ $nb -ne 2 ]; then
77 print_debug "ERROR: Should find two jobs in $tmp/log3.out waiting for Maximum Concurrent Jobs, got $nb"