3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Test truncate command in //
9 TestName="truncate-concurrent-test"
15 scripts/copy-test-confs
17 echo $src > $tmp/file-list
19 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumVolumeBytes', '2MB', 'Pool')"
20 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'ActionOnPurge', 'Truncate', 'Pool')"
21 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumConsoleConnections', 100, 'Director')"
22 $bperl -e "set_global_maximum_concurrent_jobs(100)"
26 cat >tmp/bconcmds <<END_OF_DATA
30 add storage=File pool=Default
35 @########################################################
36 @# Run a first job on TestVolume001
37 @########################################################
38 run level=full job=$JobName yes
45 check_for_zombie_jobs storage=File
52 echo "purge volume=Vol00$i$j pool=Default storage=File" >> $tmp/purgecmd
53 echo "truncate volume=Vol00$i$j pool=Default storage=File" > $tmp/bconcmds-$i$j
57 run_bconsole $tmp/purgecmd
59 for i in $tmp/bconcmds-*
61 run_bconsole $i >> $tmp/truncate.log &
65 grep "Cannot free Volume" $tmp/truncate.log > /dev/null
67 print_debug "WARNING: Should not find problems with 'Cannot free volume' in $tmp/truncate.log"