From: Kern Sibbald Date: Thu, 18 May 2017 21:09:08 +0000 (+0200) Subject: Add new truncate test X-Git-Tag: Release-7.9.0~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7ffdf6b8718179c7415a1fe4089b0464e72fb0ee;p=bacula%2Fbacula Add new truncate test --- diff --git a/regress/tests/truncate-concurrent-test b/regress/tests/truncate-concurrent-test new file mode 100755 index 0000000000..9763c37802 --- /dev/null +++ b/regress/tests/truncate-concurrent-test @@ -0,0 +1,68 @@ +#!/bin/sh +# +# Test truncate command in // +# +# +TestName="truncate-concurrent-test" +JobName=FIFOTest +. scripts/functions + +cwd=`pwd` +scripts/cleanup +scripts/copy-test-confs + +echo $src > $tmp/file-list + +$bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumVolumeBytes', '2MB', 'Pool')" +$bperl -e "add_attribute('$conf/bacula-dir.conf', 'ActionOnPurge', 'Truncate', 'Pool')" +$bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumConsoleConnections', 100, 'Director')" +$bperl -e "set_global_maximum_concurrent_jobs(100)" + +start_test + +cat >tmp/bconcmds <> $tmp/purgecmd + echo "truncate volume=Vol00$i$j pool=Default storage=File" > $tmp/bconcmds-$i$j + done +done + +run_bconsole $tmp/purgecmd + +for i in $tmp/bconcmds-* +do + run_bconsole $i >> $tmp/truncate.log & +done +wait + +grep "Cannot free Volume" $tmp/truncate.log > /dev/null +if [ $? -eq 0 ]; then + print_debug "ERROR: Should not find problems with 'Cannot free volume' in $tmp/truncate.log" + estat=1 +fi + +end_test