From 7ffdf6b8718179c7415a1fe4089b0464e72fb0ee Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 18 May 2017 23:09:08 +0200 Subject: [PATCH] Add new truncate test --- regress/tests/truncate-concurrent-test | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 regress/tests/truncate-concurrent-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 -- 2.39.5